Release #1
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: | |
| force-major: | |
| description: 'Force major version bump' | |
| required: false | |
| type: boolean | |
| default: false | |
| 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: Calculate and create tag | |
| id: version | |
| uses: mathieudutour/[email protected] | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| default_bump: ${{ inputs.force-major && 'major' || 'patch' }} | |
| release_branches: master | |
| - 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.version.outputs.new_tag }}" \ | |
| --title "${{ steps.version.outputs.new_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 |