Skip to content
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

update gorelease to use the sign step to sign the build artifacts #16

Merged
merged 1 commit into from
Feb 24, 2022
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.so
*.dylib
/apko
dist/

# Test binary, built with `go test -c`
*.test
Expand Down
29 changes: 19 additions & 10 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
project_name: apko

before:
hooks:
- go mod download

env:
- COSIGN_EXPERIMENTAL=true

builds:
- id: "apko-build"
- id: apko-build
binary: apko
main: ./cmd/apko/main.go
env:
Expand All @@ -12,32 +17,36 @@ builds:
# apko requires alpine, so only build linux binaries.
- linux
goarch:
- 386
- "386"
- amd64
- arm64
hooks:
post:
- sh -c "COSIGN_EXPERIMENTAL=true cosign sign-blob --output-certificate dist/apko_{{ .Version }}_{{ .Os }}_{{ .Arch }}.crt --output-signature dist/apko_{{ .Version }}_{{ .Os }}_{{ .Arch }}.sig {{ .Path }}"

signs:
- id: apko-cosign
cmd: cosign
certificate: "${artifact}.crt"
args: ["sign-blob", "--output-signature", "${signature}", "--output-certificate", "${certificate}", "${artifact}"]
artifacts: all

archives:
- name_template: "apko_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- files:
- LICENSE
wrap_in_directory: true

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

release:
draft: false
prerelease: true
name_template: "Release {{ .Tag }}"
extra_files:
- glob: dist/*.crt
- glob: dist/*.sig