Skip to content

Commit 12b2fc0

Browse files
committed
feat: sign release artifacts with cosign
Closes golangci#2462
1 parent fd792ae commit 12b2fc0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/release.yml

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
jobs:
88
release:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
id-token: write # for cosign
1013
env:
1114
# https://github.com/actions/setup-go#supported-version-syntax
1215
# ex:
@@ -57,6 +60,9 @@ jobs:
5760
- name: Install snapcraft
5861
run: sudo snap install snapcraft --classic
5962

63+
- name: Set up cosign
64+
uses: sigstore/cosign-installer@v3
65+
6066
- name: Set up QEMU
6167
uses: docker/setup-qemu-action@v3
6268

.goreleaser.yml

+10
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ release:
8787
8888
For key updates, see the [changelog](https://golangci-lint.run/product/changelog/#{{ .Major }}{{ .Minor }}{{ .Patch }}).
8989
90+
signs:
91+
- signature: ${artifact}.cosign.bundle
92+
cmd: cosign
93+
args:
94+
- sign-blob
95+
- --bundle=${signature}
96+
- --yes
97+
- ${artifact}
98+
artifacts: checksum
99+
90100
source:
91101
enabled: true
92102
name_template: '{{ .ProjectName }}-{{ .Version }}-source'

0 commit comments

Comments
 (0)