diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a939433..1431a07 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,9 +1,12 @@ name: Release on: - push: - tags: - - 'v*' + workflow_dispatch: + inputs: + tag: + description: 'Release tag (leave empty for auto-bump from conventional commits)' + required: false + type: string permissions: contents: write @@ -21,15 +24,50 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.24' + cache: true - name: Run tests - run: make test-integration + run: | + make build + 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 }} + github-token: ${{ secrets.GITHUB_TOKEN }} + # If GEMINI_API_KEY is unset/invalid the LLM step fails and releaseforge + # falls back to git commit-log notes, so the release still succeeds. + use-git-fallback: "true" + + - 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: distribution: goreleaser version: latest - args: release --clean + args: release --clean --release-notes ${{ steps.notes.outputs.release-notes }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}