#cargo-version #package-version #git-version #tags #bump-version #update #cargo-toml

app cargo-git-semver

automatically update package version from git tags

1 unstable release

Uses old Rust 2015

0.6.0 Aug 30, 2024

#230 in Cargo plugins

Download history 120/week @ 2024-08-28 8/week @ 2024-09-04

128 downloads per month

MIT/Apache

20KB
438 lines

cargo git-semver

Cargo command to automatically update version number.

Usage

It's designated to be used with pre-commit but can be also used independently of it.

  • automatically bump package version in Cargo.toml to match the latest git tag

    cargo git-semver bump
    
  • check whether a git tag was created f

    cargo git-semver check-tags
    

pre-commit configuration

Install pre-commit and add the following configuration to your project dir:

# .pre-commit-config.yaml
repos:
    -   repo: https://github.com/btel/cargo-semver-hook
        rev: 0.6.0
        hooks:
          - id: git-semver-bump
            args: ['--mode', 'pep440']
            files: '^(python|src|doc|Cargo\.toml|pyproject\.toml)'
            always_run: false
          - id: git-semver-check-tags

Dependencies

~15–26MB
~462K SLoC