Go (approximation) port of https://github.com/RiotGamesMinions/thor-scmversion
Usage:
go-scmversion [OPTIONS]
Application Options:
--current Print out the current version and end
--auto Bump the version based on what is found in the logs; default to #patch
--major Update Major version
--minor Update Minor version
--patch Update Patch version
--pre= Update prerelease
--write Actually write to git and output file
--dir= Directory from which to run the git commands
--file= File to write with the updated version number (default: ./VERSION)
--debug Enable debug logging of the version process
Help Options:
-h, --help Show this help message
A full process involves 3 phases of operation:
- Calculate the current version based on the git tags
- If no acceptable version is found, it defaults to "0.0.0"
- You can limit the execution to just output this via the
--currentdirective. - Increment the version forward the desired way
- The
--autodirective looks for "#major"/"#minor"/"#patch" in the git logs since the Current tag, and will bump the appropriate level if found. - Store and output the updated version
- You must use the
--writedirective to make this phase happen - This creates the tag locally, pushes tags upstream, and outputs to the
--file.