An easy to use CLI tool to manage your projects current version and its upgrades according to the Semantic Versioning specification.
If you already have golang installed you can install by running the command:
go install github.com/maykonlsf/semver-cli/cmd/semver@latestCheck if the semver was instaled running the command:
semver To start managing your project versions enter into the project folder, then run:
semver initThis command will start the versioning based on release version v1.0.0. If you want to start with another version number you car run instead:
semver init \
--release [base release version] \
[ --alpha [curent alpha number] ] \
[ --beta [current beta number] ] \
[ --rc [current release candiate number] ] \
[--force] # to override an already initialized semver in the current directory.Returns the current alpha version (if none will return and "-alpha.0" version).
$ semver get alpha
v1.0.0-alpha.6Returns the current beta version (if none will return and "-beta.0" version).
$ semver get beta
v1.0.0-beta.3Returns the current release candidate version (if none will return and "-rc.0" version).
$ semver get rc
v1.0.0-rc.1Returns the current release version.
$ semver get release
v1.0.0Increment the current alpha version by 1. If none starts with 1.
$ semver up alpha
v1.0.0-alpha.7Increment the current beta version by 1. If none starts with 1.
$ semver up beta
v1.0.0-beta.4Increment the current release candidate version by 1. If none starts with 1.
$ semver up rc
v1.0.0-rc.2Upgrade an alpha, beta or rc to its final release version. Also increments the patch number by 1 to a release version:
$ semver up release
v1.0.0
$ semver up release
v1.0.1Increments release minor version number by 1 (useful when you start working on next release version) and clear alpha, beta, rc and patch number.
$ semver up minor
v1.1.0Before you upgrade the minor version the next versions will be generated based on this new minor version.
$ semver up alpha
v1.1.0-alpha.1
$ semver up beta
v1.1.0-beta.1
$ semver up rc
v1.1.0-rc.1Upgrades the current version to the next major version (when you starts working on a new version with branking changes) and clear alpha, beta, rc, patch and minor number.
$ semver up major
v2.0.0Before them, your next versions will be generated based on this new version.
$ semver up alpha
v2.0.0-alpha.1
$ semver up beta
v2.0.0-beta.1
$ semver up rc
v2.0.0-rc.1