Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 3.01 KB

RELEASE_PROCESS.md

File metadata and controls

73 lines (45 loc) · 3.01 KB

PyMUSAS GitHub and PyPI Release Process

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 the HTTPS equivalent).

Steps

  1. Set the environment variable TAG, which should be of the form v{VERSION}.

    For example, if the version of the release is 1.0.0, you should set TAG to v1.0.0:

    export TAG='v1.0.0'

    Or if you use fish:

    set -x TAG 'v1.0.0'
  2. Update pymusas/__init__.py with the correct version and check that it matches the TAG environment variable you created in the first step.

  3. Update the CHANGELOG.md so that everything under the "Unreleased" section is now under a section corresponding to this release.

  4. 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.

  1. Check it with twine. There is a make command that can do this, this command will install build, twine, and the latest version of pip:

    make check-twine
  2. 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
    
  3. 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
    
  4. 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
    
  5. Click "Publish release". GitHub Actions will then handle the rest, including publishing the package to PyPI.

Fixing a failed release

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.