Repository navigation
Release by @tim-thacker-nullify 7d632436e699be328c2c8eccea73296bad3636f5 #141
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: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: release | |
| cancel-in-progress: true | |
| run-name: Release by @${{ github.actor }} ${{ github.sha }} | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| pull-requests: read | |
| jobs: | |
| get-version: | |
| name: Version | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| outputs: | |
| version: ${{ steps.get-version.outputs.version }} | |
| steps: | |
| - name: Get Release Version | |
| id: get-version | |
| uses: nullify-platform/github-actions/actions/release-version@main | |
| - run: | | |
| echo "**Version:** ${{ steps.get-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY | |
| echo "**Short SHA:** $(git rev-parse --short HEAD)" >> $GITHUB_STEP_SUMMARY | |
| goreleaser: | |
| if: ${{ needs.get-version.outputs.version != 'undefined' }} | |
| name: GoReleaser | |
| needs: [get-version] | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Create and push tag | |
| env: | |
| VERSION: ${{ needs.get-version.outputs.version }} | |
| run: | | |
| git tag "v${VERSION}" | |
| git push origin "v${VERSION}" | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} |