Automatic semantic versioning based on git commit messages. Use as a CLI tool, GitHub Action, or Docker container.
$ semver-gen generate -l
SEMVER 1.5.2
$ semver-gen generate -r https://github.com/user/repo
SEMVER 2.3.0
Automatic versioning that just works
Calculates version based on commit message keywords
Use directly in your CI/CD workflows
Multi-arch Docker images for any environment
Define your own trigger words for version bumps
Optional mode to respect existing git tags
Support for RC versions like 1.3.37-rc.1
Get started in seconds
brew install --cask lukaszraczylo/taps/semver-generator
Download from the releases page.
Supported: Darwin ARM64/AMD64, Linux ARM64/AMD64, Windows AMD64
docker pull ghcr.io/lukaszraczylo/semver-generator:latest
Multiple ways to use semver-generator
# Local repository
semver-gen generate -l
# Remote repository
semver-gen generate -r https://github.com/user/repo
# With custom config
semver-gen generate -l -c semver.yaml
# Strict mode (only exact matches)
semver-gen generate -l -s
# Respect existing tags
semver-gen generate -l -e
# Self-update to latest version (no auth required)
semver-gen -u
-l, --local Use local repository-r, --repository Remote repository URL-c, --config Path to config file-s, --strict Strict matching-e, --existing Respect existing tags-d, --debug Enable debug mode-u, --update Self-update to latest version-v, --version Display current versionjobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.semver.outputs.semantic_version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Generate version
id: semver
uses: lukaszraczylo/semver-generator@v1
with:
config_file: semver.yaml
repository_local: true
- name: Use version
run: echo "Version: ${{ steps.semver.outputs.semantic_version }}"
Version calculation based on commit messages
0.0.1 - PATCH - starting commit
0.0.2 - PATCH - another commit
0.0.4 - PATCH - commit with 'Update' => DOUBLE increment PATCH
0.1.0 - MINOR - commit with 'Change' => increment MINOR, reset PATCH
0.1.1 - PATCH - additional commit
1.0.1 - MAJOR - commit with 'BREAKING' => INCREMENT MAJOR, reset MINOR
1.0.2 - PATCH - another commit
Breaking changes
Keywords: "breaking"
New features
Keywords: "change", "improve"
Bug fixes
Keywords: "update", "initial"
Customize keywords and behavior
version: 1
# Starting version (optional)
force:
major: 1
minor: 0
patch: 0
commit: 69fbe2df696f40281b9104ff073d26186cde1024
# Commits to ignore
blacklist:
- "Merge branch"
- "Merge pull request"
- "feature/"
# Keywords for version bumps
wording:
patch:
- update
- initial
- fix
minor:
- change
- improve
- add
major:
- breaking
release:
- release-candidate
- add-rc