Skip to content

Commit 49a6402

Browse files
authored
Set up GoReleaser (#22)
1 parent 45ad636 commit 49a6402

File tree

3 files changed

+56
-10
lines changed

3 files changed

+56
-10
lines changed

.github/workflows/goreleaser.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version-file: 'go.mod'
23+
- name: goreleaser check
24+
uses: goreleaser/goreleaser-action@v4
25+
with:
26+
version: v1.12.3
27+
args: check

.github/workflows/release.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,29 @@ on:
77
tags:
88
- v*.*.*
99

10+
permissions:
11+
contents: write
12+
id-token: write
13+
1014
jobs:
1115
goreleaser:
1216
runs-on: ubuntu-latest
1317
steps:
1418
- name: Checkout
1519
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
1622
- name: Set up Go
1723
uses: actions/setup-go@v3
1824
with:
1925
go-version-file: 'go.mod'
20-
- name: Import GPG key
21-
id: import_gpg
22-
uses: crazy-max/ghaction-import-gpg@v5
23-
with:
24-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
25-
passphrase: ${{ secrets.PASSPHRASE }}
26+
cache: true
27+
- name: Install Cosign
28+
uses: sigstore/cosign-installer@v2
2629
- name: Run GoReleaser
2730
uses: goreleaser/goreleaser-action@v4
2831
with:
29-
version: latest
32+
version: v1.12.3
3033
args: release --rm-dist
3134
env:
3235
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.goreleaser.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,22 @@ archives:
2121
checksum:
2222
name_template: 'checksums.txt'
2323
signs:
24-
- artifacts: checksum
25-
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
24+
- cmd: cosign
25+
env:
26+
- COSIGN_EXPERIMENTAL=1
27+
signature: '${artifact}.keyless.sig'
28+
certificate: '${artifact}.pem'
29+
output: true
30+
artifacts: checksum
31+
args:
32+
- sign-blob
33+
- '--output-certificate=${certificate}'
34+
- '--output-signature=${signature}'
35+
- '${artifact}'
36+
release:
37+
github:
38+
owner: terraform-linters
39+
name: tflint-ruleset-opa
40+
draft: true
41+
snapshot:
42+
name_template: "{{ .Tag }}-dev"

0 commit comments

Comments
 (0)