Releases are largely automated via GitHub Actions. The workflow triggers when setup.py is pushed to main, creating a GitHub release and automatically preparing the dev branch for the next release.
-
On the
devbranch, check unit tests:.venv/bin/python -m coverage run -m unittest discover -vs tests -
Prepare CHANGELOG.md for release by moving
[Unreleased]changes to a new version section:## [Unreleased] Nothing yet. ## [X.Y.Z] - YYYY-MM-DD ### Added/Changed/Fixed/Removed (separate sections as applicable) - New features, changes, fixes, or removalsThe release workflow will extract this section for the GitHub release notes.
-
Add the version comparison link at the bottom of CHANGELOG.md:
[X.Y.Z]: https://github.com/homebysix/pre-commit-macadmin/compare/vPREVIOUS...vX.Y.Z -
Update the version in
setup.pyto match the CHANGELOG version (e.g.,2.3.6). -
Update the version in
README.mdexamples to match (e.g.,rev: v2.3.6). -
Commit these changes to
devand push. -
Merge
devbranch tomain. -
The release workflow will automatically:
- Detect the version from
setup.py(e.g.,2.3.6) - Create a GitHub release with tag
v2.3.6 - Extract release notes from CHANGELOG.md
- Merge
mainback todev - Bump
devversions to the next patch version (e.g.,2.3.7) insetup.pyandREADME.md - Commit and push the updated version to
dev
Note: CHANGELOG.md is NOT automatically updated on
dev. Add entries to the[Unreleased]section as you make changes. - Detect the version from
-
Pull the updated
devbranch to continue development at the new version. -
As you make changes, add entries to the
[Unreleased]section of CHANGELOG.md. When ready for the next release, simply promote those changes to a new version section (repeat from step 2) - no need to manually bump versions unless you want to change to a minor or major version. -
After each release, verify on GitHub and run
pre-commit autoupdateon a test repo to confirm it updates correctly.
The workflow automatically bumps the patch version (X.Y.Z → X.Y.Z+1). If you need to bump the minor or major version, manually update the version numbers in setup.py, README.md, and CHANGELOG.md before merging to main.
If a pre-release is desired for testing purposes, it must be done manually.