Skip to content

ci: attach a CycloneDX SBOM to each release - #376

Draft
ffroliva wants to merge 20 commits into
mainfrom
ci/0.11.0-t0.6-sbom
Draft

ffroliva wants to merge 20 commits into
mainfrom
ci/0.11.0-t0.6-sbom

Conversation

@ffroliva

@ffroliva ffroliva commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Summary

Task 0.6 of the 0.11.0 plan (#367): each GitHub Release carries a CycloneDX SBOM of the runtime dependencies, and PyPI
attestations stay on.

  • .github/workflows/release.yml: a new sbom job with contents: read only exports the frozen runtime dependencies
    (uv export --frozen --no-dev --no-default-groups --no-emit-project) and builds a CycloneDX 1.5 SBOM with a pinned
    cyclonedx-bom==9.0.2, uploaded as a one-day artifact. The publish job (needs: sbom) downloads it into
    $RUNNER_TEMP/sbom, outside dist/ (the PyPI action uploads every file in dist/), and attaches it to the GitHub
    Release. No third-party tool runs in the job that holds id-token: write.
  • PyPI attestations: pypa/gh-action-pypi-publish v1.14.3 (the pinned SHA) declares attestations with
    default: 'true'; the workflow does not override it.
  • skills/release/SKILL.md: the release assets now name the SBOM.
  • tests/test_ci_layout.py: the SBOM job, its permissions, the artifact hand-off, the release asset and the
    smoke-test command are pinned.

The SBOM generated locally from the current lock is valid CycloneDX JSON with five components, including starlette
and packaging.

This pull request is stacked on the 0.11.0 integration branch (#368 to #375); review the last three commits.

Red evidence

Change or finding Test Red before the change
SBOM attached, attestations kept tests/test_ci_layout.py::test_release_publishes_an_sbom_and_keeps_attestations_on RED (assertion under tests/)
review: the SBOM tool ran in the job holding id-token: write tests/test_ci_layout.py::test_release_sbom_is_built_outside_the_publishing_job RED (assertion under tests/): assert 'actions/download-artifact' in ...
review: an intermediate change made the smoke test call uv pip --python ... install, which uv rejects tests/test_ci_layout.py::test_release_smoke_test_installs_with_a_valid_uv_command RED (assertion under tests/)

Follow-up outside this change

The wheel smoke test installs fastapi, pydantic-settings, uvicorn and httpx from PyPI without hashes inside the
publish job. Moving the smoke test to a job without publishing rights is tracked separately.

Verification

uvx --from actionlint-py==1.7.12.25 actionlint (clean); uvx zizmor@1.32.0 --offline --min-severity low .github/workflows (no findings); uv run ruff check, uv run ruff format --check, uv run pyright (0 errors);
uv run pytest -q -n 4 tests/test_ci_layout.py tests/docs (284 passed).

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
… file

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…e protocol

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant