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: