https://github.com/jontze/conventional-versioning
A CLI tool that suggests the next version for you by analyzing the conventional commit history of your project.
https://github.com/jontze/conventional-versioning
cargo conventional-commit conventional-commits node semver semver-convention versioning
Last synced: 3 months ago
JSON representation
A CLI tool that suggests the next version for you by analyzing the conventional commit history of your project.
- Host: GitHub
- URL: https://github.com/jontze/conventional-versioning
- Owner: jontze
- License: mit
- Created: 2023-07-11T23:02:25.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T06:57:07.000Z (3 months ago)
- Last Synced: 2025-03-06T15:15:48.577Z (3 months ago)
- Topics: cargo, conventional-commit, conventional-commits, node, semver, semver-convention, versioning
- Language: Rust
- Homepage:
- Size: 500 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Conventional Versioning
[](https://github.com/jontze/conventional-versioning/actions/workflows/main.yml)
Conventional Versioning is a tool for automatically generating version numbers
based on the [Conventional Commits](https://www.conventionalcommits.org/)
specification. It uses the commit messages in your Git repository and your
latest tag to determine the next version number according to the
[Semantic Versioning](https://semver.org/) specification.## Installation
There are various ways to install Conventional Versioning. The easiest way is to
install it using
[Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)
directly from the git repository:```sh
cargo install --git https://github.com/jontze/conventional-versioning
```Alternatively, you can install it from the GitHub releases page (replace
`VERSION` with the version you want to install):```sh
curl -L https://github.com/jontze/conventional-versioning/releases/download/VERSION/conventional-versioning-VERSION-x86_64-unknown-linux-musl.tar.gz | tar -xz
```## Usage
To use Conventional Versioning, you can run the following command in your Git
repository:```sh
conventional-versioning
```This will determine the next version number based on the **commit messages** in
your repository and the latest **git tag**, and output it to stdout. You can
decide on various options to customize the output._Call the `--help` argument for more information._
```sh
Usage: conventional-versioning [OPTIONS]Options:
-r, --repo Path to the repository. Default is the current directory [env: CONVENTIONAL_VERSIONING_REPO=]
-c, --config Path to the configuration file. By default, the OS specific user configuration directories are checked. WARNING: If you use the `--config` option, all other args will be ignored, besides `--repo` [env: CONVENTIONAL_VERSIONING_CONFIG=]
-k, --kind SemVer kind. Default is the Node SemVer variant [env: CONVENTIONAL_VERSIONING_KIND=] [default: node] [possible values: node, cargo]
-o, --out Output format. Default is the human readable format [env: CONVENTIONAL_VERSIONING_OUTPUT=] [default: human] [possible values: human, plain, json, yaml, yml, toml]
-p, --patch-scope Commit scopes that cause a patch version bump [env: CONVENTIONAL_VERSIONING_PATCH=]
-m, --minor-scope Commit scopes that cause a minor version bump [env: CONVENTIONAL_VERSIONING_MINOR=]
-M, --major-scope Commit scopes that cause a major version bump [env: CONVENTIONAL_VERSIONING_MAJOR=]
-h, --help Print help
-V, --version Print version
```## Configuration
You can also provide a configuration via yaml file with the `--config` option.
Be aware that all other CLI options beside of `--repo` will be ignored if you
use the `--config` option.**The configuration file should look like this:**
```yaml
---
# Configuration for conventional-versioning
kind: Node # Node | Cargo
output: Plain # Human | Plain | Json | Yaml | Yml | Toml
prefixes:
patch:
- "fix" # e.g. fix: ... | fix(scope): ...
- "patch"
- "chore"
- "..."
minor:
- "feat"
- "..."
major:
# Commits with a "!" or "BREAKING CHANGE:"
# will always be considered as a major change
- "breaking"
- "major"
- "..."
```## License
This project is licensed under the [MIT License](./LICENSE).