Release #8
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: | |
| tag: | |
| description: 'Release tag (leave empty for auto-bump from conventional commits)' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| cache: true | |
| - name: Run tests | |
| run: go test ./... -v | |
| - name: Determine version | |
| id: version | |
| uses: AxeForging/releaseforge@main | |
| with: | |
| command: bump | |
| - name: Set tag | |
| id: tag | |
| run: | | |
| if [ -n "${{ inputs.tag }}" ]; then | |
| echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "tag=${{ steps.version.outputs.next-version }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Generate release notes | |
| id: notes | |
| uses: AxeForging/releaseforge@main | |
| with: | |
| command: generate | |
| api-key: ${{ secrets.GEMINI_API_KEY }} | |
| - name: Create and push tag | |
| run: | | |
| echo "Releasing ${{ steps.tag.outputs.tag }}" | |
| git tag ${{ steps.tag.outputs.tag }} | |
| git push origin ${{ steps.tag.outputs.tag }} | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: latest | |
| args: release --clean --release-notes ${{ steps.notes.outputs.release-notes }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |