Release
Pre-flight checks
Before tagging, verify:
Working tree is clean:
git status --shortIf there are uncommitted changes, stop and ask the user to commit or stash them first.
Current branch is
mainand up to date:git branch --show-current git fetch origin && git statusLatest pipeline on
mainis passing — check in CI/CD pipelines before tagging. A tag pushed against a failing pipeline will trigger a broken deploy. Stop and ask the user to confirm the pipeline is green.
Workflow
Read the latest tag from origin:
git fetch --tags origin git tag --sort=-version:refname | head -5Ask the user: major, minor, or patch?
Compute the next version:
- Current:
v1.2.3 - Major →
v2.0.0, Minor →v1.3.0, Patch →v1.2.4
- Current:
Propose the tag (e.g.
v1.3.0) and wait for confirmation.On confirmation, create an annotated tag and push:
git tag -a v1.3.0 -m "Release v1.3.0" git push origin v1.3.0
Pushing the tag triggers the GitLab CI tag pipeline automatically.