Release pipeline
Maintainer workflow for releasing a2c-pre-commit-hooks. This repository is consumed via Git
URL + tag in .pre-commit-config.yaml — there is no PyPI or package-registry publish step.
Aligned with superbuild-workflow where practical: curated changelog, bump_release.py, and tag
verification in CI.
Prerequisites
- Protected refs (GitLab → Settings → Repository):
- Branches:
master,develop - Tags:
v*(optional but recommended for release hygiene)
- Branches:
Changelog policy
CHANGELOG.md follows Keep a Changelog.
- Maintain
## [Unreleased]ondevelopas hooks and tooling land. - At release,
python scripts/bump_release.py:- sets
src/a2c_pre_commit_hooks/__init__.py__version__ - moves unreleased notes into
## [X.Y.Z] - YYYY-MM-DD - updates footer compare/tag links
- creates
chore(release): Bump version to X.Y.Zcommit
- sets
Release steps
- Land changes on
develop; keepCHANGELOG.mdcurated. - Wait for green CI on
develop(pre-commit,unit). - Run
python scripts/bump_release.py(add--tagto create the annotated tag locally). - Push
develop, ff-merge tomasterand wait for green CI onmaster. - Tag and push from
master:git push origin vX.Y.Z
Branch pipeline jobs
| Job | When | Purpose |
|---|---|---|
pre-commit | MR, develop, master | Run .pre-commit-config.yaml (git installed when missing) |
unit | MR, develop, master | pytest + coverage |
Tag pushes do not re-run branch jobs — validation already happened on master
before tagging.
Tag pipeline jobs
| Job | When | Purpose |
|---|---|---|
release:verify | tag vX.Y.Z | Tag matches __version__; editable install; check-changelog --help |
Failed tag pipeline (e.g. v0.1.0)
A tag pipeline uses the .gitlab-ci.yml at the tagged commit, not the current branch tip.
If v0.1.0 failed, it was tagged at 470c586 before CI fixes landed; the old ruff
job failed and release:verify never ran.
Fix going forward: branch jobs are skipped on tags; only release:verify runs.
Fix an already-pushed tag:
-
Ensure
masteris green with the fixed CI. -
Either release
v0.1.1(recommended — runbump_release.pyand push the new tag), or movev0.1.0to the currentmastertip if you intentionally keep version0.1.0:git checkout mastergit pull origin mastergit tag -d v0.1.0git tag -a v0.1.0 -m "Release 0.1.0"git push origin :refs/tags/v0.1.0git push origin v0.1.0Moving a published tag rewrites history for consumers who pinned
rev: v0.1.0; prefer a patch release when possible.
Version source of truth
src/a2c_pre_commit_hooks/__init__.py—__version__- Git tag
vX.Y.Zmust match__version__(enforced byrelease:verify)
Local dry-run
pip install -e ".[dev]"
python scripts/bump_release.py --dry-run
python scripts/verify_release_version.py v0.1.0
check-changelog --help
Consuming repos after release
Tell consumers to bump rev in .pre-commit-config.yaml to the new tag:
rev: v0.2.0
Pre-commit installs this repository from Git at that ref; no pip index is involved. Consumers may
need pre-commit clean after major hook upgrades.