Skip to content

feat: sign release artifacts with cosign #5793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # for cosign
env:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand Down Expand Up @@ -57,6 +60,9 @@ jobs:
- name: Install snapcraft
run: sudo snap install snapcraft --classic

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down
10 changes: 10 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ release:

For key updates, see the [changelog](https://golangci-lint.run/product/changelog/#{{ .Major }}{{ .Minor }}{{ .Patch }}).

signs:
Copy link
Contributor Author

@scop scop May 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-CI goreleaser release runs should likely be done with --skip sign in order to not break after we add this.

- signature: ${artifact}.cosign.bundle
cmd: cosign
Copy link
Contributor Author

@scop scop May 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess some docs how to verify downloads with cosign would not hurt. But we don't have any for verifying the sha256sums either, so not sure. #5806 contains changes for verifying in the installer script.

args:
- sign-blob
- --bundle=${signature}
- --yes
- ${artifact}
artifacts: checksum

source:
enabled: true
name_template: '{{ .ProjectName }}-{{ .Version }}-source'
Expand Down
Loading