Skip to content

Commit c005897

Browse files
committed
ci(release): keyless sign of release artifacts with Cosign
1 parent 6ae7dfa commit c005897

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ jobs:
7777

7878
goreleaser:
7979
runs-on: ubuntu-latest
80+
permissions:
81+
contents: read # for actions/checkout to fetch code
82+
id-token: write # for Cosign to be able to sign release artifacts with GHA token
8083
needs:
8184
- publish_npm_package
8285
- build-and-push-image
@@ -118,6 +121,8 @@ jobs:
118121
cat > ${{ runner.temp }}/changelog.md <<'END_OF_CHANGELOG'
119122
${{ github.event.pull_request.body }}
120123
END_OF_CHANGELOG
124+
- name: Install cosign
125+
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
121126
- name: Run GoReleaser
122127
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
123128
with:

.goreleaser.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@ builds:
6868
- darwin
6969
goarch:
7070
- arm64
71+
signs:
72+
- id: cosign-keyless
73+
cmd: cosign
74+
certificate: "${artifact}.crt"
75+
args: ["sign-blob", "--output-signature", "${signature}", "--output-certificate", "${certificate}", "${artifact}", "--yes"]
76+
artifacts: all

0 commit comments

Comments
 (0)