Repository navigation
Release to PyPI from a pushed vX.Y.Z tag, through CI - #212
Merged
Merged
Conversation
The tag is checked against pyproject.toml's version and the default branch, the full CI runs, and the sdist and wheel are built, checked with twine and a smoke test of the wheel, and published with trusted publishing. A manual run, or a pull request that changes the release machinery, is a dry run that leaves the built files to inspect. RELEASING.md describes the process. Closes #158.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #158. The same design is in liberation-data/drivine4j#284 and liberation-data/drivine#332, so all three Drivine libraries release the same way.
Process (
RELEASING.md):versioninpyproject.toml.mainwithvX.Y.Zand pushes the tag..github/workflows/release.yml.release.ymlpushof av*tag publishes.workflow_dispatch, and apull_requestthat touchesrelease.yml,RELEASING.md,pyproject.tomlorscripts/smoke_wheel.py, are dry runs that never publish. This PR's own run is the first dry run.check. On a tag push it fails with a clear message unless:vX.Y.Z(with an optional-suffix);pyproject.toml's version;main.gate. It runsci.ymlitself, which gainsworkflow_call:and is otherwise unchanged. It needscheck, so a bad tag fails fast.build.uv build(sdist, and a wheel built from it).twine check --strict.scripts/smoke_wheel.pyon Python 3.11 and 3.14. It installs the wheel into a clean venv, asserts the installed copy is the one imported, and runspython -m drivine.stubson a throwaway project.dist/as an artifact.publishruns only on a tag, in thereleaseenvironment. It publishes those exact files withpypa/gh-action-pypi-publishand trusted publishing, so no token is stored.github-releaserunsgh release create --generate-notes --verify-tag, and marks the release as a prerelease if the version has a-.contents: read, widened only per job:id-token: writeonpublish,contents: writeongithub-release.Settings for the maintainer to add (no secrets):
release. Optionally give it required reviewers and a deployment tag rulev*.drivineproject: ownerliberation-data, repositorydrivine-python, workflowrelease.yml, environmentrelease.Review. Three passes; the third was clean.
gatewaiting oncheck.Checked locally without a publish: the build,
twine check, the smoke test on 3.11 and 3.14, the tag check against a matching tag, a mismatched tag, a missingvand a commit offmain, andbash -non every step. The real publish and the trusted-publisher setup can only be tested on GitHub with a real tag.