Skip to content

Commit

Permalink
feat: add kos to release docker images with goreleaser (#148)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly authored Oct 28, 2023
1 parent dabd09c commit d56d6ea
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2
- name: Install Syft
uses: anchore/sbom-action/download-syft@78fc58e266e87a38d4194b2137a3d4e9bcaf7ca1 # v0.14.3
- name: Install Ko
uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
- name: Run GoReleaser
id: goreleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
Expand Down
24 changes: 23 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ before:
- go mod tidy

builds:
- env:
- id: kyverno-json
env:
- CGO_ENABLED=0
goos:
- linux
Expand All @@ -27,6 +28,27 @@ signs:
artifacts: all
output: true

kos:
- build: kyverno-json
repository: ghcr.io/kyverno/kyverno-json
tags:
- '{{.Tag}}'
- '{{ if not .Prerelease }}latest{{ end }}'
bare: true
preserve_import_paths: false
sbom: none
platforms:
- all

docker_signs:
- cmd: cosign
artifacts: all
output: true
args:
- sign
- ${artifact}
- --yes

archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'

Expand Down

0 comments on commit d56d6ea

Please sign in to comment.