Release #10
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
| name: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_type: | |
| description: 'Type of release' | |
| required: true | |
| type: choice | |
| options: | |
| - milestone | |
| - rc | |
| - release | |
| default: 'release' | |
| branches: ["main"] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| cache: 'maven' | |
| server-id: central | |
| server-username: MAVEN_USERNAME | |
| server-password: MAVEN_PASSWORD | |
| gpg-private-key: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} | |
| - name: Compute release version | |
| id: version | |
| run: . ./CI/compute-release-version.sh ${{ github.event.inputs.release_type }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare release commit (detached) | |
| run: . ./CI/prepare-release-commit.sh | |
| - name: Build and test | |
| run: ./mvnw --no-transfer-progress -B -T 1C install --file pom.xml | |
| - name: Deploy to Maven Central | |
| if: success() | |
| run: ./mvnw --no-transfer-progress -B -T 1C -Prelease deploy | |
| - name: Tag and push release tag | |
| if: success() | |
| run: | | |
| git tag "v${RELEASE_VERSION}" | |
| git push origin "v${RELEASE_VERSION}" | |
| - name: Create draft GitHub Release | |
| if: success() | |
| run: | | |
| # Determine base tag for release notes | |
| if [ "$IS_PRERELEASE" = "true" ]; then | |
| BASE_TAG=$(gh release list --limit 1 --exclude-drafts --json tagName -q '.[0].tagName') | |
| else | |
| BASE_TAG=$(gh release list --limit 1 --exclude-drafts --exclude-pre-releases --json tagName -q '.[0].tagName') | |
| fi | |
| TITLE="v${RELEASE_VERSION}" | |
| gh release create "v${RELEASE_VERSION}" \ | |
| --title "$TITLE" \ | |
| --notes-start-tag "$BASE_TAG" \ | |
| --generate-notes \ | |
| --draft \ | |
| --prerelease="$IS_PRERELEASE" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate Javadocs | |
| if: success() | |
| run: ./mvnw -pl springdoc-openapi-starter-common javadoc:javadoc -DskipTests | |
| - name: Prepare javadocs | |
| if: success() | |
| run: . ./CI/prepare-javadocs.sh | |
| - name: Bump SNAPSHOT version on master (final release only) | |
| if: success() && github.event.inputs.release_type == 'release' | |
| run: . ./CI/bump-snapshot.sh | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout gh-pages | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: "gh-pages" | |
| fetch-depth: 0 | |
| - name: Publish javadocs | |
| if: success() | |
| run: | | |
| TMPDIR="$(dirname -- "${0}")" | |
| . $TMPDIR/publish-javadocs.sh | |
| - name: Publish draft release | |
| if: success() | |
| run: gh release edit "v${RELEASE_VERSION}" --draft=false | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} | |
| GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PRIVATE_PASSPHRASE }} |