Skip to content

Commit 10060a9

Browse files
kotakanbeMaineK00nshino
authored
feat(ci): support signed release (#2184)
* chore(actions): Keyless signed release via GoReleaser * fix * Update .goreleaser.yml --------- Co-authored-by: MaineK00n <[email protected]> Co-authored-by: Shunichi Shinohara <[email protected]>
1 parent c270603 commit 10060a9

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

.github/workflows/goreleaser.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ on:
44
push:
55
tags:
66
- '*'
7-
8-
permissions:
7+
permissions:
98
contents: read
9+
id-token: read
1010
jobs:
1111
goreleaser:
1212
runs-on: ubuntu-latest
1313
permissions:
1414
contents: write # Needed for GoReleaser to create releases (tags, release notes, artifacts).
15+
id-token: write # For cosign
1516
steps:
16-
-
17-
name: Maximize build space
17+
- name: Cosign install
18+
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a
19+
- name: Maximize build space
1820
uses: easimon/maximize-build-space@fc881a613ad2a34aca9c9624518214ebc21dfc0c
1921
with:
2022
root-reserve-mb: 32768
@@ -23,19 +25,15 @@ jobs:
2325
remove-haskell: "true"
2426
remove-codeql: "true"
2527
remove-docker-images: "true"
26-
-
27-
name: Checkout
28+
- name: Checkout
2829
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
29-
-
30-
name: Unshallow
30+
- name: Unshallow
3131
run: git fetch --prune --unshallow
32-
-
33-
name: Set up Go
32+
- name: Set up Go
3433
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
3534
with:
3635
go-version-file: go.mod
37-
-
38-
name: Run GoReleaser
36+
- name: Run GoReleaser
3937
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552
4038
with:
4139
distribution: goreleaser

.goreleaser.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,19 @@ archives:
157157

158158
snapshot:
159159
name_template: SNAPSHOT-{{ .Commit }}
160+
161+
signs:
162+
- cmd: cosign
163+
env:
164+
- COSIGN_EXPERIMENTAL=1
165+
signature: "${artifact}.sig"
166+
certificate: "${artifact}.pem"
167+
args:
168+
- "sign-blob"
169+
- "--oidc-issuer=https://token.actions.githubusercontent.com"
170+
- "--output-certificate=${certificate}"
171+
- "--output-signature=${signature}"
172+
- "${artifact}"
173+
- "--yes"
174+
artifacts: all
175+
output: true

0 commit comments

Comments
 (0)