Skip to content

Releasing mdinterface

Only maintainers with permission to publish to PyPI and create GitHub releases can complete this workflow.

1. Bump the version

mdinterface/__init__.py defines __version__, which pyproject.toml reads dynamically. Set it to X.Y.Z without a v prefix and update __date__.

2. Promote the changelog

The Unreleased section should already contain the user-visible changes accumulated during development.

  • Rename ## [Unreleased] to ## [X.Y.Z] - YYYY-MM-DD.
  • Add a one- or two-sentence summary paragraph below the version header and above the first category heading.
  • Add a new empty ## [Unreleased] section above the released version.

The summary is required. Release CI validates it with:

python scripts/extract_changelog_summary.py X.Y.Z

3. Verify the release commit

Run the tests, build the documentation, and build the distributions:

python -m pip install build
pytest -q
mkdocs build --strict
python -m build
python scripts/verify_distribution_contents.py dist

Confirm that the wheel and source distribution contain the expected files before publishing.

4. Merge and tag

main is protected and accepts changes only through a pull request whose CI checks pass. Commit the version and changelog together on dev, push, and merge dev into main through a pull request. Then tag the merge commit:

git add mdinterface/__init__.py CHANGELOG.md
git commit -m "Bump version to X.Y.Z"
git push origin dev
gh pr create --base main --head dev --title "Release X.Y.Z"
# after the pull request is merged
git switch main && git pull
git tag vX.Y.Z
git push origin vX.Y.Z

Pushing the tag runs .github/workflows/release.yml. The workflow validates the version and changelog, checks that the tagged commit is on main and that its CI run passed, builds the distributions, publishes them to PyPI, deploys the documentation built from the tag, and creates a draft GitHub release. Pushes to main do not deploy documentation, so the published site always matches the latest release.

5. Approve PyPI and publish the GitHub release

The PyPI job runs in the pypi environment, which waits for a maintainer to approve the deployment in the Actions run. After PyPI publishing completes, the workflow creates a draft GitHub release; review its notes and artifacts, then publish it manually.

Re-running a failed release

Run the Release workflow manually and provide the existing vX.Y.Z tag. The workflow checks out that tag before validation and building; if CI failed on that commit, re-run the failed CI jobs first. Re-run publishing only when the previous attempt did not successfully upload that version to PyPI, because PyPI does not allow replacing an existing release file. To redeploy only the documentation, run the Deploy docs workflow manually with the release tag.