generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 21
chore: Enable JavaDoc Aggregate with Delombok #969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
7cbb121
Initial
newtork 1a8add4
Reduce change
newtork a4ce86e
Reduce change
newtork bc39fe9
Add workflow
newtork 9359b53
Add workflow
newtork b5aafc5
Add workflow
newtork 28eeb9f
Add workflow
newtork 57aee5d
Add workflow
newtork 38a60a7
Add workflow
newtork fa71e3a
Add workflow
newtork 8af65c4
Add workflow
newtork 542ada5
Add workflow
newtork 737b225
Add workflow
newtork 82fcb61
Add workflow
newtork bd6fb25
Add workflow
newtork d1465b8
Add workflow
newtork 1144530
Add workflow
newtork fceadbb
Add workflow
newtork 16f60da
Add workflow
newtork 6f9268f
Add workflow
newtork a9ffff5
Invoke workflow during release preparation
newtork 5e99baa
Continue on error
newtork 5febe31
Fix checkout
newtork df0c9df
Fix checkout
newtork f8c6dfa
Merge branch 'main' into javadoc-aggregate-delombok
newtork 3d011e3
Update prepare-release.yaml
newtork a83cecc
Update .github/workflows/javadoc.yaml
newtork 4d63eb8
Mention JavaDoc PR in prepare-release-workflow
newtork 9ea19cf
Merge remote-tracking branch 'origin/main' into javadoc-aggregate-del…
newtork 46fe88e
chore: Update JavaDoc Maven Plugin to `3.12.0` (#979)
newtork 3b580e5
Make javadoc branch name predictable; Automatically merge on perform-…
newtork c4b7908
Merge remote-tracking branch 'origin/javadoc-aggregate-delombok' into…
newtork 0ebdce0
Merge branch 'main' into javadoc-aggregate-delombok
Jonas-Isr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| name: JavaDoc to Documentation Portal | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch: | ||
| description: 'Branch/Commit/Tag for JavaDoc' | ||
| required: true | ||
| default: 'main' | ||
|
|
||
| env: | ||
| JAVA_VERSION: 17 | ||
| DOCS_REPO: SAP/cloud-sdk | ||
| PROJECTS: "!:rfc,!:dwc-cf,!:datamodel-metadata-generator,!:odata-generator,!:odata-generator-maven-plugin,!:odata-generator-utility,!:odata-v4-generator,!:odata-v4-generator-maven-plugin,!:s4hana-connectivity,!:soap,!:testutil,!:s4hana-core" | ||
|
|
||
| jobs: | ||
| build: | ||
| name: "JavaDoc to Documentation Portal" | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: "Prepare git" | ||
| run: | | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "SAP Cloud SDK Bot" | ||
|
|
||
| - name: "Checkout Repository" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: "Switch branch" | ||
| run: git checkout "${{ github.event.inputs.branch || 'main' }}" | ||
|
|
||
| - name: "Set up JDK 17" | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
|
|
||
| - name: "Determine Versions" | ||
| id: determine-version | ||
| run: | | ||
| echo "MAJOR_VERSION=$(jq -r '.version' latest.json | cut -d '.' -f 1)" >> $GITHUB_OUTPUT | ||
| echo "CURRENT_VERSION=$(jq -r '.version' latest.json" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: "Install project (skip tests)" | ||
| run: mvn install -DskipTests --quiet | ||
|
|
||
| - name: "Process sources" | ||
| run: mvn process-sources -Drelease --fail-at-end --projects "${PROJECTS}" --quiet | ||
|
|
||
| - name: "Copy delombok sources" | ||
| run: find . -type d -path "*/target/delombok" -exec sh -c 'cp -r "$1"/* "$(dirname $(dirname "$1"))/src/main/java/"' _ {} \; | ||
|
|
||
| - name: "Generate aggregated Javadoc" | ||
| run: mvn clean javadoc:aggregate -Drelease -Djava.failOnWarning=false --projects "${PROJECTS}" --quiet | ||
|
|
||
| - name: "Checkout Docs Repository" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: ${{ env.DOCS_REPO }} | ||
| path: .cloud-sdk-docs | ||
| token: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }} | ||
|
|
||
| - name: "Replace JavaDoc" | ||
| id: replace-javadoc | ||
| run: | | ||
| TARGET_DIR=./.cloud-sdk-docs/static/java-api/v${{ steps.determine-version.outputs.MAJOR_VERSION }} | ||
|
|
||
| ls -lA target | ||
| rm -rf $TARGET_DIR | ||
| mkdir -p $TARGET_DIR | ||
| mv target/reports/apidocs/* $TARGET_DIR | ||
|
|
||
| cd ./.cloud-sdk-docs | ||
| git add -A . | ||
|
|
||
| CHANGED_FILES="$(git status -s)" | ||
| if [[ -z "$CHANGED_FILES" ]]; then | ||
| echo "[DEBUG] No changes to API docs detected, skipping Pull Request creation." | ||
| echo "CREATE_PR=false" >> $GITHUB_OUTPUT | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "CREATE_PR=true" >> $GITHUB_OUTPUT | ||
| BRANCH_NAME=java/release-docs-${{ steps.determine-version.outputs.CURRENT_VERSION }} | ||
| echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT | ||
|
|
||
| git switch --create $BRANCH_NAME | ||
| git commit -m "chore: Update JavaDocs for release ${{ steps.determine-version.outputs.CURRENT_VERSION }}" | ||
| COMMIT_SHA=$(git log -1 --pretty=format:"%H") | ||
| echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_OUTPUT | ||
|
|
||
| git push origin $BRANCH_NAME | ||
|
|
||
| - name: "Create JavaDoc PR" | ||
| id: create-javadoc-pr | ||
| if: ${{ steps.replace-javadoc.outputs.CREATE_PR == 'true' }} | ||
| working-directory: ./.cloud-sdk-docs | ||
| run: | | ||
| PR_TITLE="Java: Update JavaDocs for release ${{ needs.bump-version.outputs.release-version }}" | ||
| PR_BODY="Replace the contents of v${{ steps.determine-version.outputs.MAJOR_VERSION }} API docs with the latest release of the SDK." | ||
|
|
||
| PR_URL=$(gh pr create --title "$PR_TITLE" --body "$PR_BODY" --repo "${{ env.DOCS_REPO }}") | ||
| echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT | ||
| echo "PR: $PR_URL" >> $GITHUB_STEP_SUMMARY | ||
| env: | ||
| GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.