50 releases (13 breaking)

9.0.2 Oct 30, 2024
0.16.0 Dec 7, 2024
0.15.0 Nov 30, 2024
0.9.0 May 8, 2024
0.4.0 Jul 31, 2022

#84 in Math

Download history 177/week @ 2024-08-17 335/week @ 2024-08-24 433/week @ 2024-08-31 476/week @ 2024-09-07 388/week @ 2024-09-14 562/week @ 2024-09-21 1171/week @ 2024-09-28 1304/week @ 2024-10-05 1242/week @ 2024-10-12 1120/week @ 2024-10-19 615/week @ 2024-10-26 663/week @ 2024-11-02 463/week @ 2024-11-09 451/week @ 2024-11-16 307/week @ 2024-11-23 589/week @ 2024-11-30

1,849 downloads per month

MIT license

150KB
3K SLoC

nextsv

Crates.io MIT licensed Build Status Rust 1.74+ FOSSA Status Docs BuyMeaCoffee GitHubSponsors codecov

A utility to calculate the level of change and the next semantic version number based on the conventional commits since the last version tag.

Feature set

  • Calculate next semantic version number
  • Calculate the level to change for next semantic version number
  • Support basic semantic version components: Major, Minor, and Patch
  • Check for required files (e.g. CHANGELOG.md)
  • Set level of change (Breaking, Feature, Fix, Other) at which required files are required
  • Check that any changes made meet a specified level
  • Support pre-release versions (alpha, beta, rc)
  • Update to release version (removing pre-release identifiers)
  • Handle case where no tag is found

CLI Usage

Install the CLI using cargo install.


cargo install nextsv

Run in your project directory and check the version

$ nextsv --version
nextsv 0.16.0

Running the application provides the level for the next semantic version change.


$ nextsv
[2022-08-03T06:33:54Z INFO  nextsv] Calculating the next version level
minor

Help provides all the options


$ nextsv -h
jerusdp <jrussell@jerus.ie>
Next semantic version calculator

USAGE:
    nextsv [OPTIONS]

OPTIONS:
    -f, --force <FORCE>      Force the calculation of the version number [possible values: major,
                             minor, patch, first]
    -h, --help               Print help information
        --level              Report the level of the version number change
        --number             Report the version number
    -p, --prefix <PREFIX>    Prefix string to identify version number tags [default: v]
    -q, --quiet              Pass many times for less log output
    -v, --verbose            Pass many times for more log output
    -V, --version            Print version information
$

A clean response of the level to update is reported using the -q flag.


$ nextsv -q
minor

This can be used with cargo release to update and publish a new release.


cargo release $(nextsv -q)

Further details on usage scenarios can be found here.

Library Usage

To use the library add the crate to dependencies in the project's Cargo.toml.


[dependencies]
nextsv = "0.16.0"

Dependencies

~14–26MB
~389K SLoC