Skip to content

Commit 477d822

Browse files
committed
add: workflow
1 parent 6c2e41a commit 477d822

2 files changed

Lines changed: 60 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: "1.24"
24+
25+
- name: Import GPG key
26+
id: import_gpg
27+
uses: crazy-max/ghaction-import-gpg@v6
28+
with:
29+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
30+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
31+
32+
- name: Run GoReleaser
33+
uses: goreleaser/goreleaser-action@v6
34+
with:
35+
distribution: goreleaser
36+
version: "~> v2"
37+
args: release --clean
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.goreleaser.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,23 @@ archives:
2727

2828
checksum:
2929
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
30-
algorithm: sha256
30+
algorithm: sha256
31+
32+
signs:
33+
- artifacts: checksum
34+
cmd: gpg2
35+
args:
36+
- "--batch"
37+
- "-u"
38+
- "{{ .Env.GPG_FINGERPRINT }}"
39+
- "--output"
40+
- "${signature}"
41+
- "--detach-sign"
42+
- "${artifact}"
43+
44+
changelog:
45+
sort: asc
46+
filters:
47+
exclude:
48+
- "^docs:"
49+
- "^test:"

0 commit comments

Comments
 (0)