Release #4
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: | |
| version: | |
| description: 'Version to release (leave empty for auto-detection based on commits)' | |
| required: false | |
| type: string | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Auto-detect version | |
| id: auto | |
| if: ${{ !inputs.version }} | |
| uses: mathieudutour/[email protected] | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| default_bump: patch | |
| release_branches: master | |
| tag_prefix: "" | |
| - name: Manual version | |
| id: manual | |
| if: ${{ inputs.version }} | |
| run: | | |
| git tag "${{ inputs.version }}" | |
| git push origin "${{ inputs.version }}" | |
| - name: Set release tag | |
| id: release | |
| run: echo "tag=${{ inputs.version || steps.auto.outputs.new_tag }}" >> $GITHUB_OUTPUT | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| - name: Publish to staging | |
| run: ./gradlew publishAllPublicationsToStagingRepository | |
| - name: Deploy with JReleaser | |
| uses: jreleaser/release-action@v2 | |
| with: | |
| arguments: deploy | |
| env: | |
| JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "${{ steps.release.outputs.tag }}" \ | |
| --title "${{ steps.release.outputs.tag }}" \ | |
| --generate-notes | |
| - name: Upload JReleaser logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jreleaser-logs | |
| path: | | |
| out/jreleaser/trace.log | |
| out/jreleaser/output.properties |