Skip to content

Commit 4b7c7f0

Browse files
committed
chore: configuring github workflows and add signing to goreleaser
1 parent c0405cc commit 4b7c7f0

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

.github/workflows/release.yaml

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

.goreleaser.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ before:
1616
- go generate ./...
1717

1818
builds:
19-
- id: cli
20-
main: ./cmd/cli/
19+
- main: ./cmd/cli/
2120
env:
2221
- CGO_ENABLED=0
2322
goos:
@@ -46,3 +45,15 @@ changelog:
4645
exclude:
4746
- "^docs:"
4847
- "^test:"
48+
49+
signs:
50+
- artifacts: checksum
51+
cmd: gpg2
52+
args:
53+
- "--batch"
54+
- "-u"
55+
- "{{ .Env.GPG_FINGERPRINT }}"
56+
- "--output"
57+
- "${signature}"
58+
- "--detach-sign"
59+
- "${artifact}"

0 commit comments

Comments
 (0)