Skip to content

Commit 4978345

Browse files
committed
Attach SBOM assets to releases
1 parent e095ed8 commit 4978345

6 files changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ jobs:
6363
outputs:
6464
backend-attestation-url: ${{ steps.attest-backend.outputs.attestation-url }}
6565
frontend-attestation-url: ${{ steps.attest-frontend.outputs.attestation-url }}
66+
backend-digest: ${{ steps.push-backend.outputs.digest }}
67+
frontend-digest: ${{ steps.push-frontend.outputs.digest }}
6668
steps:
6769
- name: Checkout
6870
uses: actions/checkout@v4
@@ -152,17 +154,66 @@ jobs:
152154
runs-on: ubuntu-latest
153155
permissions:
154156
contents: write
157+
packages: read
155158
steps:
159+
- name: Checkout
160+
uses: actions/checkout@v4
161+
156162
- name: Set lowercase owner
157163
id: vars
158164
run: echo "owner=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
159165
shell: bash
160166

167+
- name: Log in to GHCR
168+
uses: docker/login-action@v3
169+
with:
170+
registry: ghcr.io
171+
username: ${{ github.actor }}
172+
password: ${{ secrets.GITHUB_TOKEN }}
173+
174+
- name: Prepare release asset directory
175+
run: mkdir -p dist/release-assets
176+
shell: bash
177+
178+
- name: Generate source SBOM asset
179+
uses: anchore/sbom-action@v0.20.9
180+
with:
181+
path: .
182+
format: spdx-json
183+
syft-version: v1.41.2
184+
output-file: dist/release-assets/repo-source-${{ github.ref_name }}.spdx.json
185+
upload-artifact: false
186+
upload-release-assets: false
187+
188+
- name: Generate backend image SBOM asset
189+
uses: anchore/sbom-action@v0.20.9
190+
with:
191+
image: ghcr.io/${{ steps.vars.outputs.owner }}/nextjs-python-computer-vision-kit-backend@${{ needs.publish-images.outputs.backend-digest }}
192+
format: spdx-json
193+
syft-version: v1.41.2
194+
output-file: dist/release-assets/backend-runner-${{ github.ref_name }}.spdx.json
195+
upload-artifact: false
196+
upload-release-assets: false
197+
198+
- name: Generate frontend image SBOM asset
199+
uses: anchore/sbom-action@v0.20.9
200+
with:
201+
image: ghcr.io/${{ steps.vars.outputs.owner }}/nextjs-python-computer-vision-kit-frontend@${{ needs.publish-images.outputs.frontend-digest }}
202+
format: spdx-json
203+
syft-version: v1.41.2
204+
output-file: dist/release-assets/frontend-runner-${{ github.ref_name }}.spdx.json
205+
upload-artifact: false
206+
upload-release-assets: false
207+
161208
- name: Publish release
162209
uses: softprops/action-gh-release@v2
163210
with:
164211
generate_release_notes: true
165212
append_body: true
213+
files: |
214+
dist/release-assets/repo-source-${{ github.ref_name }}.spdx.json
215+
dist/release-assets/backend-runner-${{ github.ref_name }}.spdx.json
216+
dist/release-assets/frontend-runner-${{ github.ref_name }}.spdx.json
166217
body: |
167218
## Published Images
168219
@@ -173,3 +224,17 @@ jobs:
173224
174225
- Backend image: ${{ needs.publish-images.outputs.backend-attestation-url }}
175226
- Frontend image: ${{ needs.publish-images.outputs.frontend-attestation-url }}
227+
228+
## Attached SBOM Assets
229+
230+
- `repo-source-${{ github.ref_name }}.spdx.json`
231+
- `backend-runner-${{ github.ref_name }}.spdx.json`
232+
- `frontend-runner-${{ github.ref_name }}.spdx.json`
233+
234+
## Verification
235+
236+
```bash
237+
docker login ghcr.io
238+
gh attestation verify oci://ghcr.io/${{ steps.vars.outputs.owner }}/nextjs-python-computer-vision-kit-backend:${{ github.ref_name }} -R ${{ github.repository }}
239+
gh attestation verify oci://ghcr.io/${{ steps.vars.outputs.owner }}/nextjs-python-computer-vision-kit-frontend:${{ github.ref_name }} -R ${{ github.repository }}
240+
```

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ If you modify request or response shapes:
134134
6. Confirm the release smoke workflow passes against the published images, or dispatch it manually for a tag if you need to re-check a release.
135135

136136
The release notes will also include links to the image provenance attestations generated during the publish workflow.
137+
The release itself will also carry attached SPDX SBOM files for the source tree and the published runner images.
137138

138139
The component labels used by Release Drafter are synced from `.github/labels.json`, and most of the common ones are applied automatically from changed paths.
139140

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ An SBOM workflow also publishes SPDX artifacts for the repository source plus th
139139
- Pushing a tag like `v0.1.0` triggers the release workflow.
140140
- That workflow verifies the tagged commit, publishes backend/frontend images to GHCR, and creates a GitHub Release with generated notes.
141141
- The release workflow also generates build-provenance attestations for the published GHCR images and links them from the release notes.
142+
- The GitHub Release also includes attached SPDX SBOM assets for the source tree and both runner images.
142143
- A follow-up smoke workflow pulls those published GHCR images and checks backend health, a real inference request, and the frontend shell before you treat the release as healthy.
143144
- Maintainers can re-run the same check manually with `BACKEND_IMAGE=... FRONTEND_IMAGE=... npm run check:release-smoke`.
144145

SECURITY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ The repository also uses automated scanning to help catch common security issues
3636
- GitHub SBOM artifacts for the repository source and runner images
3737
- GitHub build-provenance attestations for published release images
3838

39+
Tagged releases also include attached SPDX SBOM files and release-note verification snippets for the published container images.
40+
3941
Dependency review is also configured with an allowlist that matches the current dependency tree, so changes that introduce new license types are surfaced deliberately instead of silently drifting in.
4042

4143
Those checks do not replace private disclosure. If you believe a vulnerability is real or

future-reference-feature.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ What it covers here:
177177
- tag-triggered release workflow
178178
- GHCR publishing
179179
- build-provenance attestations for published container images
180+
- attached SBOM release assets for published source and runtime artifacts
180181
- release smoke test against published images
181182
- synced repository labels
182183

@@ -192,6 +193,7 @@ Generic takeaway:
192193
- if the repo is public and meant to last, release automation is worth it
193194
- release smoke tests are especially valuable because they test the thing users actually consume
194195
- provenance attestations strengthen trust in published artifacts without requiring manual signing steps
196+
- attaching SBOMs directly to releases makes supply-chain metadata easier for downstream users to consume
195197

196198
### 7. Repo Governance and Maintainer UX
197199

template-playbook.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ If a template only has code and no repo workflow, it is usually still a prototyp
5353
- label sync
5454
- publish workflow
5555
- provenance attestations for published artifacts when possible
56+
- attach SBOMs to releases when you publish installable artifacts or images
5657
- release smoke test
5758

5859
### Repo Governance
@@ -161,6 +162,7 @@ If you want the version that scales better for open source or long-term reuse, a
161162
- dependency licenses should be reportable without manual digging
162163
- SBOMs should be generated for source trees or release artifacts when supply-chain visibility matters
163164
- published artifacts should have provenance attestations when the platform supports them
165+
- release notes should tell consumers how to verify what you published
164166
- release steps should be automated
165167
- docs should explain maintainer flow, not just user setup
166168

0 commit comments

Comments
 (0)