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.
-
Determine the version to release. After each release, the workflow auto-bumps
setup.pyondevto the next patch version — so for a normal patch release,setup.pyondevalready holds the correct next version; use that value as-is in the steps below. Only editsetup.pyyourself first if you're bumping the minor or major version instead (see Version Numbering). -
On the
devbranch, check unit tests:.venv/bin/python -m coverage run -m unittest discover -vs tests -
Update the generated AutoPkg processor version table from a local AutoPkg checkout:
.venv/bin/python scripts/generate_autopkg_processor_versions.py --autopkg-repo ../autopkg .venv/bin/python -m coverage run -m unittest discover -vs testsUse
--fullwhen the generator logic changes, historical AutoPkg tags are added or corrected, or you need to rebuild from AutoPkg0.1.0. The default mode appends stable releases newer than the checked-inlast_walked_version. -
Prepare CHANGELOG.md for release by moving
[Unreleased]changes to a new version section, using the version determined in step 1 above forX.Y.Z:## [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 -
Confirm the version in
setup.pymatches the CHANGELOG version (e.g.,2.3.6). For a normal patch release this should already be true from the auto-bump; only change it here if you're doing a minor/major release. -
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.