Skip to content

Commit

Permalink
sign release artifacts using cosign
Browse files Browse the repository at this point in the history
Signed-off-by: Prashant Rewar <108176843+prashantrewar@users.noreply.github.com>
  • Loading branch information
prashantrewar committed Jan 4, 2024
1 parent 6a1f7d1 commit e15845f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: "1.21.3"

- name: Set up Cosign
uses: sigstore/cosign-installer@v3

- name: Retrieve version
run: |
Expand Down Expand Up @@ -89,6 +92,14 @@ jobs:
${checksums['ytt-linux-amd64']} ./ytt-linux-amd64
${checksums['ytt-linux-arm64']} ./ytt-linux-arm64
${checksums['ytt-windows-amd64.exe']} ./ytt-windows-amd64.exe`
- name: Verify checksums signature
run: |
cosign verify-blob \
--cert dist/checksums.txt.pem \
--signature dist/checksums.txt.sig \
--certificate-identity-regexp=https://github.com/${{ github.repository_owner }} \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com ./dist/checksums.txt
- name: verify uploaded artifacts
if: startsWith(github.ref, 'refs/tags/')
Expand Down
11 changes: 11 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ checksum:
name_template: 'checksums.txt'
algorithm: sha256
disable: false
signs:
- artifacts: checksum
certificate: '${artifact}.pem'
cmd: cosign
args:
- sign-blob
- "--yes"
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
output: true
snapshot:
name_template: "{{ .Tag }}-next"
release:
Expand Down

0 comments on commit e15845f

Please sign in to comment.