From ccbd9e250c787d2eb7cc9df0aedf11783afa77fd Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Fri, 22 Aug 2025 10:55:56 +0200 Subject: [PATCH] Disable binary signing in snapshot mode Snapshot builds failed for external contributors due to cosign. Since snapshot builds are not official releases, we do not need to sign binaries. Disabling signing in this mode fixes the issue. Signed-off-by: Bryan Frimin --- .goreleaser.yaml | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index f99c4806f..1a640c90a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -74,16 +74,18 @@ sboms: - "--source-version={{ .Version }}" signs: - - cmd: cosign + - cmd: sh env: - COSIGN_EXPERIMENTAL=1 certificate: "${artifact}.pem" args: - - sign-blob - - "--output-certificate=${certificate}" - - "--output-signature=${signature}" - - "${artifact}" - - "--yes" + - -c + - | + if [ "{{ .IsSnapshot }}" = "true" ]; then + echo "Skipping signing (snapshot: {{ .IsSnapshot }})" + else + cosign sign-blob --output-certificate="${certificate}" --output-signature="${signature}" "${artifact}" --yes + fi artifacts: checksum output: true @@ -101,25 +103,33 @@ docker_manifests: docker_signs: - id: images - cmd: cosign + cmd: sh env: - COSIGN_EXPERIMENTAL=1 artifacts: images output: true args: - - "sign" - - "${artifact}@${digest}" - - "--yes" + - -c + - | + if [ "{{ .IsSnapshot }}" = "true" ]; then + echo "Skipping Docker image signing (snapshot: {{ .IsSnapshot }})" + else + cosign sign "${artifact}@${digest}" --yes + fi - id: manifests - cmd: cosign + cmd: sh env: - COSIGN_EXPERIMENTAL=1 artifacts: manifests output: true args: - - "sign" - - "${artifact}@${digest}" - - "--yes" + - -c + - | + if [ "{{ .IsSnapshot }}" = "true" ]; then + echo "Skipping Docker manifest signing (snapshot: {{ .IsSnapshot }})" + else + cosign sign "${artifact}@${digest}" --yes + fi dockers: - image_templates: