Skip to content

Commit

Permalink
ci(goreleaser): sign artifacts with cosign
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Oct 21, 2023
1 parent c06af4e commit d3057bd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
!docs/**/*.png
!tools/*
!internal/**/*.png
!cosign.*
# ...even if they are in subdirectories
!*/

Expand Down
11 changes: 11 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ builds:
pre:
- go generate ./...

signs:
- cmd: cosign
stdin: '{{ .Env.COSIGN_PWD }}'
args:
- "sign-blob"
- "--key=cosign.key"
- "--output-signature=${signature}"
- "${artifact}"
- "--yes" # needed on cosign 2.0.0+
artifacts: all

archives:
- format: binary

Expand Down
11 changes: 11 additions & 0 deletions cosign.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN ENCRYPTED SIGSTORE PRIVATE KEY-----
eyJrZGYiOnsibmFtZSI6InNjcnlwdCIsInBhcmFtcyI6eyJOIjo2NTUzNiwiciI6
OCwicCI6MX0sInNhbHQiOiJBdWJVSWszUmNGT2MrV0hONnV3U2ltRE14QXkzSlF6
NHFDT0crdzQwZ0Q0PSJ9LCJjaXBoZXIiOnsibmFtZSI6Im5hY2wvc2VjcmV0Ym94
Iiwibm9uY2UiOiJEczZHSC92YXRqdWRCRkR6YktRYXgxeFYvUmV0RGJweSJ9LCJj
aXBoZXJ0ZXh0IjoiSkQxSnhWTEQzWStVekFsaVFBdStsVG55d2l5QzZ6S2k3WXVB
MXNHbmVRb0dsUHNQeWF0QjYyWTlvNlIybkJURHo4MVpob2hZK2dCQUhzR2FjNWJm
c1VqWEJVWk1MaW5FVGkxdUZST09OL0poa2xIa2d5UnhrUVc4bzU1RGVxRDNjcjBk
a0o1VnlsR1hBejdlbDhtR0lxeTZ2NmhwSThueHg0b3dsZlAzM3IxVm1aUW9WejN4
TmljL3lMb0QxREFJd3I1amo2Ym40L0NaY0E9PSJ9
-----END ENCRYPTED SIGSTORE PRIVATE KEY-----
4 changes: 4 additions & 0 deletions cosign.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJVfVTRU9qlJ6F+eZTQO/KSo3bmZn
ooVnvYAquh44OQbmT87BtzeyvMYj2f8VKj653B5lU6P+lkJ/i72XDK8DuA==
-----END PUBLIC KEY-----

0 comments on commit d3057bd

Please sign in to comment.