Releasing
- page Releasing
Python package on PyPI
One-time setup (project owner):
Create the
fields2coverproject on https://pypi.org and https://test.pypi.org (first upload creates it; alternatively register a pending publisher).On both, add a Trusted Publisher: owner
Fields2Cover, repositoryFields2Cover, workflowpypi.yml, environmentpypi(resp.testpypi).In the GitHub repository create the environments
pypiandtestpypi(Settings → Environments). Optionally require reviewers forpypi.
Per release:
Make sure
CHANGELOG.mdhas an## [Unreleased]section describing the release; it becomes the release notes.Optional dry run: Actions → PyPI → Run workflow → target: testpypi, then
pip install --index-url fields2cover.From an up-to-date, clean
mainrun./release.sh X.Y.Z(needs the GitHub CLI,gh auth login). It bumps the version inCMakeLists.txtandpackage.xml, turns[Unreleased]into the[X.Y.Z]section, shows the diff and — after confirmation — commits, pushes and publishes the GitHub releasevX.Y.Z. The same steps can be done by hand; publishing the release is what triggers the upload.The
PyPIworkflow builds the sdist, installs it in a clean container and uploads it. If thepypienvironment requires reviewers, approve the deployment in the running workflow. The workflow refuses to publish whenpackage.xmlandCMakeLists.txtdisagree or when the tag does not matchVERSIONinCMakeLists.txt.A published PyPI release cannot be replaced or re-uploaded. If a release turns out to be broken, release a patch version the same way.