Skip to content

Commit 6f0c635

Browse files
committed
ci: add .goreleaser.yml
1 parent bd72d09 commit 6f0c635

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
- name: Checkout
16+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1617
with:
1718
fetch-depth: 0
18-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
19+
- name: Set up Go
20+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
1921
with:
2022
go-version-file: 'go.mod'
2123
cache: true
@@ -25,9 +27,13 @@ jobs:
2527
with:
2628
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
2729
passphrase: ${{ secrets.PASSPHRASE }}
30+
git_user_signingkey: true
31+
git_commit_gpgsign: true
2832
- name: Run GoReleaser
2933
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
3034
with:
35+
distribution: goreleaser
36+
version: '~> v2'
3137
args: release --clean
3238
env:
3339
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: 2
2+
before:
3+
hooks:
4+
- go mod tidy
5+
builds:
6+
- env:
7+
- CGO_ENABLED=0
8+
mod_timestamp: '{{ .CommitTimestamp }}'
9+
flags:
10+
- -trimpath
11+
ldflags:
12+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
13+
goos:
14+
- freebsd
15+
- windows
16+
- linux
17+
- darwin
18+
goarch:
19+
- amd64
20+
- '386'
21+
- arm
22+
- arm64
23+
ignore:
24+
- goos: darwin
25+
goarch: '386'
26+
binary: '{{ .ProjectName }}_v{{ .Version }}'
27+
archives:
28+
- format: zip
29+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
30+
checksum:
31+
extra_files:
32+
- glob: 'terraform-registry-manifest.json'
33+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
34+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
35+
algorithm: sha256
36+
signs:
37+
- artifacts: checksum
38+
args:
39+
- "--batch"
40+
- "--local-user"
41+
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
42+
- "--output"
43+
- "${signature}"
44+
- "--detach-sign"
45+
- "${artifact}"
46+
release:
47+
extra_files:
48+
- glob: 'terraform-registry-manifest.json'
49+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
50+
changelog:
51+
disable: true

0 commit comments

Comments
 (0)