Skip to content

Release Process

Joel Davies edited this page Jul 18, 2024 · 15 revisions

Branches

  • develop is the default branch that should be used for development and is the one that gets dependabot updates

Release branches

  • main should be the latest release branch
  • v1.x, v2.x should only be created from main when older versions must be maintained e.g. if a facility cannot upgrade immediately due to migrations.

For general releases

When it is time to release the following steps should be followed

  1. Update the version within the pyproject.toml following https://semver.org/
  2. Merge develop into the appropriate release branch
  3. Go to the GitHub Releases section and create a new release
    1. Creating a new tag of the version in the form vX.Y.Z
    2. Select the release branch as the target and click Generate release notes (Then modify as appropriate)
    3. Ensure Set as the latest release is checked as appropriate
    4. Ensure Set as the latest release is checked as appropriate
    5. Click Publish release

This will trigger the release-build action that will generate and push a new Docker image to Harbor with the tags X.Y and X.Y.Z.

For a Docker image patch

If only updating a Docker base image (e.g. for a security update), a patch version is not required. In this case you should

  1. Merge the update into the appropriate release branch
  2. Pull the release branch locally
  3. Ensure any local tags have been removed e.g. git fetch --prune --prune-tags
  4. Tag the release branch with the same latest tag for that release branch e.g. git tag vX.Y.Z --force (The force is needed as it should already exist)
  5. Then push the tags to origin using git push origin <release branch> --tags --force

This will trigger the release-build action that will generate and push a new Docker image to Harbor with the tags X.Y and X.Y.Z. The release notes do not need updating in this case.

Warning

Do not attempt to patch a non latest patch version this way, as the X.Y tag should point to the latest version of the minor release.

Notes

Cherry picking docker image or package updates

If you wish to update a Docker image or package update on a release branch that has already been merged on develop without merging all other changes on the current develop branch, use the following steps:

  1. Checkout a new branch to merged into the release branch e.g. patch-docker-images
  2. Find the commit SHA of the update commit(s) you wish to put onto the release branch (can be found through git log or via GitHub) - Merge commits should be ignored.
  3. While on the new branch Use git cherry-pick commitSha1 commitSha2 ...
  4. Create a PR merging the new branch into the release branch
Clone this wiki locally