Release #32
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: { } | |
| permissions: { } | |
| jobs: | |
| create-release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: write # Required to create releases | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # tag=v6.0.3 | |
| with: | |
| submodules: 'true' | |
| - name: Set up JDK | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # tag=v5.2.0 | |
| with: | |
| java-version: "21" | |
| distribution: temurin | |
| cache: maven | |
| server-id: central | |
| server-username: MAVEN_CENTRAL_USERNAME | |
| server-password: MAVEN_CENTRAL_PASSWORD | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: GPG_PASSPHRASE | |
| - name: Perform Release | |
| id: perform-release | |
| env: | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| run: |- | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| mvn -B -Pgithub-actions release:clean release:prepare | |
| TAG_NAME="$(sed -nr 's/^scm.tag=(v[0-9.]+)$/\1/p' release.properties)" | |
| echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT | |
| mvn -B release:perform | |
| - name: Rollback Failed Release | |
| if: always() && steps.perform-release.outcome == 'failure' | |
| run: |- | |
| mvn -B release:rollback | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| TAG_NAME: "${{ steps.perform-release.outputs.TAG_NAME }}" | |
| REF_NAME: "${{ github.ref_name }}" | |
| run: |- | |
| gh release create "${TAG_NAME}" \ | |
| --target "${REF_NAME}" \ | |
| --verify-tag \ | |
| --generate-notes |