From 402b2a39170a1553901114f989197eec0b3fdc55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Sun, 29 Oct 2023 00:05:36 +0200 Subject: [PATCH] feat: add kos to release docker images with goreleaser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/release.yaml | 2 ++ .goreleaser.yaml | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d21a0b08..d390e458 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 461ad9a8..4ff24afe 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -3,7 +3,8 @@ before: - go mod tidy builds: - - env: + - id: kyverno-json + env: - CGO_ENABLED=0 goos: - linux @@ -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 }}'