Making a release#
Releases are published to PyPI and get their own frozen copy of the documentation, both automatically, when a version tag is pushed.
One-time setup#
On PyPI, add a trusted publisher for this repository at https://pypi.org/manage/account/publishing/ with owner
GriffithsLab, repositorywhobpyt, workflowrelease.ymland environmentpypi. No API token is needed.In the GitHub repository settings, under Environments, create an environment called
pypi. You can require a maintainer’s approval there before anything is published.
Each release#
On
main, set the version inwhobpyt/__init__.py, for example__version__ = "0.1.0".Add the new version to
doc/_static/versions.jsonso it appears in the version switcher, and mark it as the preferred one:{ "name": "0.1.0 (stable)", "version": "0.1.0", "url": "https://griffithslab.github.io/whobpyt/0.1.0/", "preferred": true }
Remove
"preferred": truefrom the previous release.Merge these changes, then tag the merge commit and push the tag:
$ git tag v0.1.0 $ git push origin v0.1.0
The tag must match the version exactly, or the release workflow stops. Creating a release on GitHub with this tag works too.
The Release workflow builds the package and publishes it to PyPI, and the Docs workflow publishes the documentation at
https://griffithslab.github.io/whobpyt/0.1.0/.Back on
main, set the version to the next development version, for example__version__ = "0.2.0.dev0".
The documentation at the site root always shows the latest main branch,
labelled “dev” in the version switcher.