Skip to content

Commit 98e8adf

Browse files
authored
Merge pull request #7 from AxeForging/chore/release-workflow-dispatch
Switch release workflow to manual dispatch with releaseforge
2 parents bbfb68e + 4f65c0e commit 98e8adf

1 file changed

Lines changed: 43 additions & 5 deletions

File tree

.github/workflows/release.yaml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- 'v*'
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Release tag (leave empty for auto-bump from conventional commits)'
8+
required: false
9+
type: string
710

811
permissions:
912
contents: write
@@ -21,15 +24,50 @@ jobs:
2124
uses: actions/setup-go@v5
2225
with:
2326
go-version: '1.24'
27+
cache: true
2428

2529
- name: Run tests
26-
run: make test-integration
30+
run: |
31+
make build
32+
go test ./... -v
33+
34+
- name: Determine version
35+
id: version
36+
uses: AxeForging/releaseforge@main
37+
with:
38+
command: bump
39+
40+
- name: Set tag
41+
id: tag
42+
run: |
43+
if [ -n "${{ inputs.tag }}" ]; then
44+
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
45+
else
46+
echo "tag=${{ steps.version.outputs.next-version }}" >> "$GITHUB_OUTPUT"
47+
fi
48+
49+
- name: Generate release notes
50+
id: notes
51+
uses: AxeForging/releaseforge@main
52+
with:
53+
command: generate
54+
api-key: ${{ secrets.GEMINI_API_KEY }}
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
# If GEMINI_API_KEY is unset/invalid the LLM step fails and releaseforge
57+
# falls back to git commit-log notes, so the release still succeeds.
58+
use-git-fallback: "true"
59+
60+
- name: Create and push tag
61+
run: |
62+
echo "Releasing ${{ steps.tag.outputs.tag }}"
63+
git tag ${{ steps.tag.outputs.tag }}
64+
git push origin ${{ steps.tag.outputs.tag }}
2765
2866
- name: Run GoReleaser
2967
uses: goreleaser/goreleaser-action@v6
3068
with:
3169
distribution: goreleaser
3270
version: latest
33-
args: release --clean
71+
args: release --clean --release-notes ${{ steps.notes.outputs.release-notes }}
3472
env:
3573
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)