-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 1.65 KB
/
release.yml
File metadata and controls
67 lines (57 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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 }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- 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 }}