Skip to content

Commit 79f875b

Browse files
authored
changes for cosign v3 compatibility (#2877)
### Problem Cosign v3.0.2 removed support for `--output-signature` and `--output-certificate` flags in favor of bundle format. Workflows were failing with: ``` Error: must provide --bundle with --signing-config or --use-signing-config ``` ### Solution Updated all `cosign sign-blob` commands to use bundle format: ```bash cosign sign-blob <file> --yes --bundle=<file>.bundle ``` ### Files Changed **compile-docs.yml:** - Simplified 3 cosign commands to use --bundle only - Created placeholder .sig/.crt files for backward compatibility - Updated tar archive to include .bundle files - Updated release artifacts to use .bundle - Updated verification instructions for bundle format **compile-public-docs.yml:** - Simplified 2 cosign commands to use --bundle only - Created placeholder .sig/.crt files for backward compatibility - Updated release to include .bundle files ### Why Placeholder Files? The Dockerfile and some verification scripts still expect .sig/.crt files. Created empty placeholders to maintain compatibility during transition. The real verification data is in the .bundle files. ### Backward Compatibility - Tar archives include both .bundle files (real) and .sig/.crt (placeholders) - GitHub releases include .bundle files - Verification instructions updated to use bundle format - Dockerfile continues to work (copies placeholder files) Signed-off-by: ltagliaferri <[email protected]>
1 parent bfeb2ba commit 79f875b

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

.github/workflows/compile-docs.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -143,39 +143,40 @@ jobs:
143143
run: |
144144
cd $TEMP_BUILD_DIR
145145
146-
# Sign the main documentation file
146+
# Sign the main documentation file (bundle format for cosign v3)
147147
cosign sign-blob chainguard-complete-docs.md \
148148
--yes \
149-
--new-bundle-format=false \
150-
--output-signature=chainguard-complete-docs.md.sig \
151-
--output-certificate=chainguard-complete-docs.md.crt
149+
--bundle=chainguard-complete-docs.md.bundle
152150
153-
# Sign the checksums file
151+
# Sign the checksums file (bundle format for cosign v3)
154152
cosign sign-blob checksums.txt \
155153
--yes \
156-
--new-bundle-format=false \
157-
--output-signature=checksums.txt.sig \
158-
--output-certificate=checksums.txt.crt
159-
154+
--bundle=checksums.txt.bundle
155+
156+
# Create placeholder .sig/.crt files for backward compatibility
157+
# (verification.sh and some tools still expect these)
158+
touch chainguard-complete-docs.md.sig chainguard-complete-docs.md.crt
159+
touch checksums.txt.sig checksums.txt.crt
160+
160161
# Copy verification script
161162
cp $GITHUB_WORKSPACE/edu/scripts/verification.sh .
162163
163164
# Create release bundle with all verification files
164165
tar -czf chainguard-ai-docs.tar.gz \
165166
chainguard-complete-docs.md \
167+
chainguard-complete-docs.md.bundle \
166168
chainguard-complete-docs.md.sig \
167169
chainguard-complete-docs.md.crt \
168170
checksums.txt \
171+
checksums.txt.bundle \
169172
checksums.txt.sig \
170173
checksums.txt.crt \
171174
verification.sh
172175
173-
# Sign the bundle
176+
# Sign the bundle (bundle format for cosign v3)
174177
cosign sign-blob chainguard-ai-docs.tar.gz \
175178
--yes \
176-
--new-bundle-format=false \
177-
--output-signature=chainguard-ai-docs.tar.gz.sig \
178-
--output-certificate=chainguard-ai-docs.tar.gz.crt
179+
--bundle=chainguard-ai-docs.tar.gz.bundle
179180
180181
- name: Build and push container image
181182
if: github.ref == 'refs/heads/main'
@@ -276,20 +277,19 @@ jobs:
276277
Cryptographically signed documentation for AI coding assistants.
277278
278279
### Verification Instructions
279-
280+
280281
```bash
281-
# Download and verify the bundle
282282
# Download latest release
283283
curl -LO https://github.com/${{ github.repository }}/releases/latest/download/chainguard-ai-docs.tar.gz
284-
curl -LO https://github.com/${{ github.repository }}/releases/latest/download/chainguard-ai-docs.tar.gz.sig
285-
286-
# Verify with cosign
284+
curl -LO https://github.com/${{ github.repository }}/releases/latest/download/chainguard-ai-docs.tar.gz.bundle
285+
286+
# Verify with cosign (bundle format)
287287
cosign verify-blob \
288+
--bundle chainguard-ai-docs.tar.gz.bundle \
288289
--certificate-identity-regexp ".*github.com/${{ github.repository }}.*" \
289290
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
290-
--signature chainguard-ai-docs.tar.gz.sig \
291291
chainguard-ai-docs.tar.gz
292-
292+
293293
# Extract and verify contents
294294
tar -xzf chainguard-ai-docs.tar.gz
295295
./verification.sh
@@ -308,8 +308,6 @@ jobs:
308308
- Build date: ${{ github.event.repository.updated_at }}
309309
files: |
310310
${{ env.TEMP_BUILD_DIR }}/chainguard-ai-docs.tar.gz
311-
${{ env.TEMP_BUILD_DIR }}/chainguard-ai-docs.tar.gz.sig
312-
${{ env.TEMP_BUILD_DIR }}/chainguard-ai-docs.tar.gz.crt
313311
${{ env.TEMP_BUILD_DIR }}/chainguard-ai-docs.tar.gz.bundle
314312
draft: false
315313
prerelease: false

.github/workflows/compile-public-docs.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,21 @@ jobs:
114114
run: |
115115
cd static/downloads
116116
117-
# Sign the tarball (keyless signing)
117+
# Sign the tarball (bundle format for cosign v3)
118118
cosign sign-blob chainguard-ai-docs.tar.gz \
119119
--yes \
120-
--new-bundle-format=false \
121-
--output-signature=chainguard-ai-docs.tar.gz.sig \
122-
--output-certificate=chainguard-ai-docs.tar.gz.crt
120+
--bundle=chainguard-ai-docs.tar.gz.bundle
123121
124-
# Sign the markdown file
122+
# Sign the markdown file (bundle format for cosign v3)
125123
cosign sign-blob chainguard-ai-docs.md \
126124
--yes \
127-
--new-bundle-format=false \
128-
--output-signature=chainguard-ai-docs.md.sig \
129-
--output-certificate=chainguard-ai-docs.md.crt
130-
125+
--bundle=chainguard-ai-docs.md.bundle
126+
127+
# Create placeholder .sig/.crt files for backward compatibility
128+
# (Dockerfile and some tools still expect these)
129+
touch chainguard-ai-docs.tar.gz.sig chainguard-ai-docs.tar.gz.crt
130+
touch chainguard-ai-docs.md.sig chainguard-ai-docs.md.crt
131+
131132
echo "Artifacts signed successfully"
132133
133134
- name: Scan for sensitive data
@@ -213,8 +214,8 @@ jobs:
213214
--notes-file release-notes.md \
214215
--latest \
215216
chainguard-ai-docs.tar.gz \
216-
chainguard-ai-docs.tar.gz.sig \
217-
chainguard-ai-docs.tar.gz.crt \
217+
chainguard-ai-docs.tar.gz.bundle \
218+
chainguard-ai-docs.md.bundle \
218219
checksums.txt
219220
220221
- name: Build and push container image

0 commit comments

Comments
 (0)