Create a tagged release with auto-generated release notes from recent commits.
- Run
git log --oneline $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEADto list commits since last tag. - Determine the next version number:
- If
--major,--minor, or--patchis specified, use that increment. - Otherwise, infer from commit types:
feat= minor,fix= patch, breaking changes = major.
- If
- Group commits by type (features, fixes, chores, etc.) for the release notes.
- Check for a
package.json,pyproject.toml, orCargo.tomland update the version field if present. - Stage version file changes and commit with
chore: bump version to vX.Y.Z. - Create an annotated tag:
git tag -a vX.Y.Z -m "Release vX.Y.Z". - If
ghCLI is available, create a GitHub release:gh release create vX.Y.Z --generate-notes. - Push the tag and commit:
git push origin HEAD --follow-tags.
## vX.Y.Z (YYYY-MM-DD)
### Features
- feat(scope): description
### Bug Fixes
- fix(scope): description
### Other Changes
- chore/refactor/docs entries
- Never create a release on a dirty working tree; abort if uncommitted changes exist.
- Always use semantic versioning (semver).
- Confirm the version bump with the user before tagging.
- Do not include merge commits or CI-only changes in release notes.