This document provides general information and steps about the project's release procedure.
If you're reading this, this will likely not be useful to you, unless you have administrator permissions in the repository or want to replicate this setup in your own project :p
The process is largely automated, with manual action only being needed where higher permissions are required.
Note that pre-releases (alpha/beta/rc) don't quite work with the current setup; we don't currently anticipate making pre-releases, but this may still be improved in the future.
These steps are mostly equivalent for major/minor (feature) and micro (bugfix) releases.
The branch should be master
for major/minor releases and e.g. 1.2.x
for micro releases.
- Run the
Create Release PR
workflow from the GitHub UI (or CLI), specifying the correct branch and new version.- Wait until a PR containing the changelog and version bump is created. Update the changelog description and merge the PR.
- In the CLI, fetch changes and create + push a tag for the newly created commit, which will trigger another workflow.
- [if latest] Also force-push a
stable
tag for the same ref.
- [if latest] Also force-push a
- Update the visibility of old/new versions on https://readthedocs.org.
- Approve the environment deployment when prompted, which will push the package to PyPI.
- Update and publish the created GitHub draft release, as well as a Discord announcement. 🎉
- [if major/minor] Create a
v1.2.x
branch for future backports, and merge the newly created dev version PR.
If the automated process above does not work for some reason, here's the abridged version of the manual release process:
- Update version in
__init__.py
, runtowncrier build
. Commit, push, create + merge PR. - Follow steps 1.ii. + 1.iii. like above.
- Run
python -m build
, attach artifacts to GitHub release. - Run
twine check dist/*
+twine upload dist/*
. - Follow steps 2.i. + 3. like above.
This automated process requires some initial one-time setup in the repository to work properly:
- Create a GitHub App (docs), enable write permissions for
content
andpull_requests
. - Install the app in the repository.
- Set repository variables
GIT_APP_USER_NAME
andGIT_APP_USER_EMAIL
accordingly. - Set repository secrets
BOT_APP_ID
andBOT_PRIVATE_KEY
. - Create a
release-pypi
environment, add protection rules. - Set up trusted publishing on PyPI (docs).