what-bump is a simple tool that reads the commit history of a git repository,
and uses commit messages to decide what kind of version bump is required.
Moreover, if you provide
what-bump with the current version number of your software,
it will tell you what the next version number has to be.
However, most of those tools are deeply integrated with NPM, or somehow assume that you're
using NPM, try to manage the entire release process of your software, and are not trivial
to set up (especially if you're not using NPM!).
The only tool I could find that does not integrate with NPM is
calcver, but it is very
young, very undocumented, and probably more powerful and/or complex than I need a tool
what-bump, sets out to be a simple, self-explanatory, zero-configuration
utility to do one and only one thing: determine your software's next version number
bases on all the commit messages up to a previous revision. You need to specify what
the previous revision is (we assume you have it tagged and know enough
bash magic to
do it) and what the current version is (ditto).
To get all the explanation you need.
Basically, assuming you tagged your previous version as
v1.0.2, just type
what-bump v1.0.2 --from 1.0.2
to get the next version number printed to standard output.
what-bump is a little bit more accepting than Conventional Commits specifies.
In particular, it only checks that the commit type starts with "fix" or "feat" (case insensitive), therefore it will also accept things like "feature", "fixed", or "fixing".
Also, any other commit type, or commits that don't comply with the spec, will be ignored and won't contribute to a version bump.
what-bump is written in Rust. You'll need at least version
1.36 to build (that's what I used). Install rust following the instruction on the official
what-bump depends on git2-rs, which requires
libgit2 to be installed on your system. It should already be available if you're using git.
cargo build --release
and install locally with
cargo install --path .
Alternatively, if you have docker, you can build
the Dockerfile provided:
docker build . -t what-bump