#git #conventional-commit #semver #versioning

bin+lib conventional-semver-rs

CLI and library to manage your git projects semantic version based on conventional commits

2 unstable releases

Uses new Rust 2021

0.2.0 Oct 14, 2022
0.1.0 Oct 7, 2022

#906 in Development tools

MIT license

501 lines

Conventional Semantic Versions

Blazingly Fast 🚀 CLI tool for determining the next semantic version for a given repository based on conventional commits and git tags.

⚠️ This is in very early development. I would not recommend you integrate this tool into your project.


    conver [OPTIONS] [PATH]

    <PATH>    Path to target git repository [default: .]

    -f, --bump-files    Bump the version files with the derived version
    -h, --help          Print help information
    -r, --release       Generate final release version
    -t, --tag           Tag the current commit with the release version
    -v, --lead-v        Add an optional leading v to the generated version i.e. (v2.1.3)
    -V, --version       Print version information


conventional-semver-rs will look in the root of the repositories directory for a conventional_release.toml file. This configuration will be applied when generating versions of updating version files. If conventional_release.toml is not found, a default configuration will be loaded.

Default Configuration

v = false

name = "conventional-semver-rs"
email = "conventional-semver-rs@github.com"

Configuration Options

v = false # Include optional prefix v in generated version

# Customize the commit signature when bumping files and creating tags
name = "conventional-semver-rs"
email = "conventional-semver-rs@github.com"

# Describes a file containing the application's version to be updated on release
v = true # Configure option prefix v for version file
path = "version.txt" # Relative path to file
version_prefix = "" # Token to match before the version
version_postfix = "" # Token to match after the version

# Cargo.toml example
v = false
path = "Cargo.toml"
version_prefix = "version = \""
version_postfix = "\"[^,]"

# Preset example
# presets are for common version files,
# so you don't have to write the regex!
preset = "package.json"
# Currently Supported Presets
# - "Cargo.toml"
# - "package.json"

Pre-release Versions

Pre-release versions are generated when the following conditions are true.

  • The current commit is not tagged. (See Rebuilding Release Tags below.)
  • The --release option is not specified.
    • Example: 0.3.0-2-g3229751

Release Versions

Release versions are generated when the either of the following conditions are true.

  • The current commit is already tagged with a release version.
  • The --release option is specified.
  • Structure is {MAJOR}.{MINOR}.{PATCH}
    • Example: 0.3.0


~411K SLoC