Reference this guide has been adapted from the AllenNLP release process guide, many thanks to the AllenNLP team for creating the original guide.
This document describes the procedure for releasing new versions of the core library.
❗️ This assumes you are using a clone of the main repo with the remote
origin
pointed to[email protected]:UCREL/pymusas.git
(or theHTTPS
equivalent).
-
Set the environment variable
TAG
, which should be of the formv{VERSION}
.For example, if the version of the release is
1.0.0
, you should setTAG
tov1.0.0
:export TAG='v1.0.0'
Or if you use
fish
:set -x TAG 'v1.0.0'
-
Update
pymusas/__init__.py
with the correct version and check that it matches theTAG
environment variable you created in the first step. -
Update the
CHANGELOG.md
so that everything under the "Unreleased" section is now under a section corresponding to this release. -
Update the
CITATION.cff
file to refer to the right version and date of release. Validate the changes against the citation file format (cff) schema you can run the following docker command (the docker image is around 257MB in size):
docker run --rm -v $PWD:/app citationcff/cffconvert --validate
For more information about CITATION.cff files see the Citation File Format website.
-
Check it with twine. There is a make command that can do this, this command will install
build
,twine
, and the latest version ofpip
:make check-twine
-
Add these changes using Git manually (
git add
), then commit and push these changes with:git commit -m "Prepare for release $TAG" && git push origin main
-
Then add the tag in git to mark the release (When prompted for a tag message use "Release v{VERSION}"):
git tag -s $TAG && git push origin main --tags
-
Find the tag you just pushed on GitHub, click the "..." to the right of the "Verified" badge, and then click "Create release". Set the title of the release to "v{VERSION}" and copy the output from the following script into the markdown text box:
python scripts/release_notes.py
-
Click "Publish release". GitHub Actions will then handle the rest, including publishing the package to PyPI.
If for some reason the GitHub Actions release workflow failed with an error that needs to be fixed, you'll have to delete both the tag and corresponding release from GitHub. After you've pushed a fix, delete the tag from your local clone with
git tag -l | xargs git tag -d && git fetch -t
Then repeat the steps above.