Release Tagging
Create and tag a new release version.
Process
- •Check current state: Run
git describe --tags --abbrev=0 2>/dev/null || echo "no tags"to find the latest tag - •List recent tags: Run
git tag --sort=-v:refname | head -10to show recent version history - •Determine version:
- •If a version argument was provided, use it (ensure it starts with
v, e.g.,v1.2.3) - •Otherwise, ask the user what version to tag using AskUserQuestion with options:
- •Patch bump (e.g., v1.0.0 -> v1.0.1)
- •Minor bump (e.g., v1.0.0 -> v1.1.0)
- •Major bump (e.g., v1.0.0 -> v2.0.0)
- •Custom version
- •If a version argument was provided, use it (ensure it starts with
- •Show changes: Run
git log --oneline $(git describe --tags --abbrev=0 2>/dev/null)..HEADto show commits since last tag - •Create tag: Run
git tag -a <version> -m "Release <version>" - •Check if commit is on remote: Run
git branch -r --contains HEADto check if the tagged commit has been pushed to main - •Ask about push: Ask user if they want to push the tag to remote. If the tagged commit is not yet on remote main, also offer to push main.
- •Push if requested: Run
git push origin <version>andgit push origin mainif needed
Version Format
This project uses semantic versioning with a v prefix:
- •
v1.0.0- Major.Minor.Patch - •
v0.1.0-alpha- Pre-release versions are also supported
Example Usage
code
/release # Interactive - will prompt for version /release v1.2.3 # Tag specific version