build: Invoke a full-release upon releasing #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: EarlyAccess | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| precheck: | |
| if: github.repository == 'kordamp/gm' && startsWith(github.event.head_commit.message, 'Releasing version') != true | |
| runs-on: ubuntu-latest | |
| outputs: | |
| VERSION: ${{ steps.vars.outputs.VERSION }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Cancel previous run | |
| uses: styfle/cancel-workflow-action@0.12.1 | |
| with: | |
| access_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Version | |
| id: vars | |
| shell: bash | |
| run: | | |
| echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT | |
| release: | |
| needs: [ precheck ] | |
| if: endsWith(${{ needs.precheck.outputs.VERSION }}, '-SNAPSHOT') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25.3' | |
| - name: Assemble | |
| uses: jreleaser/release-action@v2 | |
| with: | |
| arguments: assemble | |
| env: | |
| JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }} | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: JReleaser assemble output | |
| if: always() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| retention-days: 1 | |
| name: jreleaser-assemble | |
| path: | | |
| out/jreleaser/trace.log | |
| out/jreleaser/output.properties | |
| - name: Release | |
| uses: jreleaser/release-action@v2 | |
| with: | |
| arguments: release | |
| env: | |
| JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }} | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
| - name: JReleaser release output | |
| if: always() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| retention-days: 1 | |
| name: jreleaser-release | |
| path: | | |
| out/jreleaser/trace.log | |
| out/jreleaser/output.properties |