Skip to content

Trusted publishing, release-please, dependabot - #9

Merged
rkoopmans merged 7 commits into
masterfrom
ci/trusted-publishing
Nov 28, 2026
Merged

rkoopmans merged 7 commits into
masterfrom
ci/trusted-publishing

Conversation

@rkoopmans

Copy link
Copy Markdown
Owner

No description provided.

rkoopmans and others added 2 commits November 28, 2026 13:19
ubuntu-latest now resolves to Ubuntu 26.04, for which actions/setup-python
has no Python 3.8 or 3.9 builds, so the 3.8/3.9 jobs fail at setup.
Ubuntu 24.04 still provides every version in the matrix (3.8-3.14).
@rkoopmans
rkoopmans force-pushed the ci/trusted-publishing branch from b41fa42 to 62ac35a Compare November 28, 2026 12:20
The github.com fixtures (2020 DigiCert leaf -> DigiCert SHA2 High
Assurance Server CA -> DigiCert High Assurance EV Root CA) depend on a
root Mozilla has retired. Current CA bundles (Ubuntu ca-certificates
20260816, Fedora) no longer ship it, so the system-store tests fail on
the Python 3 runners.

- Use the chain github.com serves today: github.com -> Sectigo Public
  Server Authentication CA DV E36 -> Sectigo Public Server
  Authentication Root E46 (the root is resolved via the intermediate's
  AIA .p7c). Fixture PEMs are Cert.export() output; values cross-checked
  with openssl.
- test_find_root looks roots up in a bundle built from the fixture roots
  instead of the host CA bundle, so it no longer depends on which roots
  the OS ships (the Python 2.7 image's 2019 bundle lacks Root E46).
- The root-not-found warning test now makes the root download fail
  explicitly, since the new chain's root is reachable via AIA.
- Drop the unused pem_github fixture (conftest.py) and the old DigiCert
  certificates.
Replace the PYPI_ACCESS_TOKEN upload with PyPI Trusted Publishing (OIDC).
The publish step now runs in its own job in the "pypi" environment with
only id-token: write, so gh-action-pypi-publish can mint a short-lived
upload token and attach signed PEP 740 provenance attestations.

- Split the old Publish job into Build (build + install checks, uploads
  dist/ as an artifact) and Publish (downloads dist/, uploads to PyPI)
- Enable skip-existing so re-running Publish can complete a partially
  uploaded release
- Default the workflow token to contents: read
- Bump checkout to v4, setup-python to v5; drop unused wheel install
- Use the current input name print-hash; packages-dir defaults to dist/
Add a release-please job to the CI/CD workflow. On every push to master
(after tests and mypy pass) it maintains a release PR; merging that PR
creates the tag and GitHub release, which then runs Build and Publish.
Publishing stays in ci-cd.yml because tags created by the job do not
trigger other workflows, and the PyPI trusted publisher is bound to this
workflow file. The manual tag-push trigger is removed.

Release safety:
- Build publishes only if the release tag points at the commit this run
  tested (github.sha), so a release PR whose own run failed or is still
  running can't be published from a later run's release-please
- A concurrency group serialises release-please runs
- workflow_dispatch on a release tag re-runs the tests on that tag and
  publishes it, to recover from a failed or refused publish
- Clear errors when the tag and __version__ disagree, stating that the
  GitHub release exists without a PyPI upload

Configuration:
- Tags keep the existing format without a "v" prefix (e.g. 1.4.2)
- __version__ is bumped via the x-release-please-version annotation
- Commit search is bootstrapped from the 1.4.1 release commit
- Only feat, fix, perf, deps and revert commits trigger a release;
  docs/chore/ci/etc. are hidden
- Add the missing 1.4.1 CHANGELOG entry so release-please continues
  from a complete history

Release-As: 1.4.2
Pin every action to a full commit SHA with the matching release tag as a
trailing comment, so a moved or compromised tag can't change what runs in
CI or in the PyPI publish job. Dependabot keeps both SHA and comment
up to date.

Each action is pinned to the latest release in the major it already
used; the stragglers (checkout@v3 in mypy, setup-python@v4 in the test
jobs) are aligned to the same pinned versions:

- actions/checkout                 v4.4.0
- actions/setup-python             v5.6.0
- actions/upload-artifact          v4.6.2
- actions/download-artifact        v4.3.0
- codecov/codecov-action           v4.6.0
- googleapis/release-please-action v4.4.1
- pypa/gh-action-pypi-publish      v1.14.3
Weekly, grouped updates for the SHA-pinned actions. A 14-day cooldown
means only releases that have been public for two weeks are proposed,
giving time for a compromised or broken release to be caught first.
Commits use the "ci" prefix so they don't trigger a release-please
release on their own.

pip is intentionally not tracked: requirements.txt feeds install_requires
(cryptography>=3.1) and Dependabot would raise that floor for users.
@rkoopmans
rkoopmans force-pushed the ci/trusted-publishing branch from 62ac35a to 54143bd Compare November 28, 2026 12:30
@rkoopmans rkoopmans changed the title Trusted publishing and release please Trusted publishing, release-please, dependabot Nov 28, 2026
@codecov

codecov Bot commented Nov 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
cert_chain_resolver/castore/file_system.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rkoopmans
rkoopmans merged commit 9f96362 into master Nov 28, 2026
14 checks passed
@rkoopmans
rkoopmans deleted the ci/trusted-publishing branch November 28, 2026 12:32
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