Releasing¶
Releases are published to PyPI by .github/workflows/release.yml when a version tag is pushed. It uses PyPI trusted publishing, so no PyPI token is stored anywhere: PyPI checks that the upload comes from this repository's release workflow.
One-time setup (owner)¶
-
PyPI project. Sign in to pypi.org, open Your account → Publishing → Add a new pending publisher, and enter:
Field Value PyPI project name ouncemcpOwner subbusainathRepository name ouncemcpWorkflow name release.ymlEnvironment name pypiThe first successful release creates the project. Optionally, do the same on test.pypi.org to rehearse.
-
GitHub environment. In Settings → Environments, create
pypi. Add yourself as a required reviewer, so every upload waits for your approval, and under Deployment branches and tags allow only tags matchingv*. -
Tag protection. The
release-tagsruleset (.github/rulesets/release-tags.json) stops version tags from being moved or deleted once pushed.
Cutting a release¶
- Check the gates. Every release gate in spec section 14.2 must pass:
- CI is green on
main. - Gate 6, the accuracy check: run
ouncemcp bench benchmarks/bench.yaml --compare benchmarks/results/m3-bench.json --fail-on-regression. It costs about $2.20 in model calls. - Gate 7, the performance check: run
benchmarks/scripts/m4_release_perf.py.
- CI is green on
- Set the version in both
pyproject.toml(version) andsrc/ouncemcp/__init__.py(__version__). The workflow refuses a tag that does not match both. - Update
CHANGELOG.md. Turn the "unreleased" heading into the version and date. For 1.0, also change theDevelopment Statusclassifier inpyproject.tomlto5 - Production/Stable. - Merge those changes to
mainthrough a pull request. -
Tag and push from the merged
main: -
Approve the
pypideployment when GitHub asks. The workflow:- builds the wheel and the source package;
- installs the wheel into a clean environment and checks the version;
- uploads both files to PyPI.
- Create a GitHub release from the tag, with the CHANGELOG entry as its notes.
If something goes wrong¶
PyPI never lets a file be replaced. If an upload is wrong, fix it on main and release the next patch version. If the problem is serious, yank the bad version on PyPI. Never move or reuse a tag.