Skip to content

Improve PyPI release infrastructure - #2

Merged
kephale merged 2 commits into
mainfrom
improve-release-infra
Jun 7, 2026
Merged

kephale merged 2 commits into
mainfrom
improve-release-infra

Conversation

@kephale

@kephale kephale commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces the deploy jobs that were bolted onto the CI workflow with a dedicated, more robust release pipeline, and slims CI down to testing + linting.

release.yml (new)

  • Version guard — verifies the v* tag matches the pyproject.toml and Cargo.toml versions before publishing anything.
  • Test gate — a native Linux build+test must pass before wheels are built, so a broken build never reaches an index.
  • Broader wheel coverage — manylinux and musllinux for x86_64 + aarch64, Windows x64, macOS x86_64 + arm64. (abi3 means one wheel per platform/arch, valid for CPython 3.10+.)
  • Validation before publish — collects all artifacts and runs twine check (now fatal, previously non-fatal) before any publish step.
  • Trusted publishing + attestations — PyPI publish on tag via OIDC (no API token) with PEP 740 attestations enabled.
  • TestPyPI on demand — workflow_dispatch with a target input, also via trusted publishing (replaces the token-based test_pypi.yml).
  • GitHub Release — created automatically with notes extracted from CHANGELOG.md and the built wheels/sdist attached.

ci.yml (renamed from test_and_deploy.yml)

  • Test matrix (Linux/macOS/Windows × Python 3.10–3.13) + fmt/clippy lint.
  • No longer triggers on tags or carries deploy jobs — CI and release are now separate concerns.

Removed

  • test_pypi.yml — folded into release.yml.

⚠️ Action required before the next release

PyPI/TestPyPI trusted publishers are configured per workflow filename. The publisher was set up for test_and_deploy.yml; update it (on both PyPI and TestPyPI) to point at release.yml, and create a testpypi GitHub Environment (the pypi environment already exists). Without this, the publish step will be rejected with an OIDC error.

Test plan

  • Both workflows validated as parseable YAML; needs/artifact names cross-checked.
  • CHANGELOG extraction awk verified against the real CHANGELOG.md (0.1.0 section).
  • First real exercise will be the v0.1.0 tag (or a TestPyPI dry run via Actions → Release → Run workflow → testpypi).

kephale added 2 commits June 7, 2026 08:45
Replace the deploy jobs that were bolted onto the CI workflow with a
purpose-built release pipeline, and slim the CI workflow to test + lint.

release.yml (new):
- Verifies the git tag matches the pyproject.toml and Cargo.toml versions
  before anything is published.
- Native Linux test gate so a broken build never reaches an index.
- Broader wheel coverage: manylinux + musllinux for x86_64 and aarch64,
  Windows x64, macOS x86_64 + arm64 (abi3, one wheel per platform/arch).
- Collects all artifacts and runs twine check (now fatal) before publishing.
- Publishes to PyPI on a v* tag via trusted publishing (OIDC) with PEP 740
  attestations; TestPyPI is available on demand via workflow_dispatch.
- Creates a GitHub Release with notes extracted from CHANGELOG.md and the
  built artifacts attached.

ci.yml (renamed from test_and_deploy.yml):
- Test matrix (Linux/macOS/Windows x Python 3.10-3.13) plus the fmt/clippy
  lint job. No longer triggers on tags or carries deploy jobs.

Remove test_pypi.yml; TestPyPI publishing now lives in release.yml and uses
trusted publishing instead of a long-lived API token.
maturin develop requires an activated virtualenv, which the runners don't
have. Build a wheel and pip-install it instead, which works uniformly on
Linux/macOS/Windows without venv activation.
@kephale
kephale merged commit 059ef43 into main Jun 7, 2026
13 checks passed
@kephale
kephale deleted the improve-release-infra branch June 7, 2026 16:00
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