This library determines a next release version for a git repository.
It can be used as a library or as a standalone tool.
The rules for determining the next version are following:
- The library recognises tags in the format:
release/x.y.z
orvx.y.z
possibly with a suffix-X-g<short SHA-1 hash commit id>
- It is not possible to change the major version as part of a hotfix
- The requested major version must be increased by at most 1
- If the repository has not been tagged yet the initial version will be
0.1.0
- A major version bump from
x.y.z
will result in a next version ofx+1.0.0
- If it is a hotfix for version
x.y.z
the new version will becomex.y.z+1
- Otherwise the minor version will be increased by 1
- An unrecognised tag format will cause throwing an exception
ReleaseVersioning.version(
release = <a Boolean value>,
hotfix = <a Boolean value>,
gitDescribe = <an Option[String] with `git describe` value>,
majorVersion = <an Int with the desired major version>
)
You can see the available options by running the assembly jar with:
java -jar $WORKSPACE/release-versioning/target/scala-2.10/release-versioning-assembly-x.y.z.jar --help
Usage: release-versioning [options]
--help prints this usage text
--release release is an optional flag indicating whether it should be a release or a snapshot
--hotfix hotfix is an optional flag indicating whether it should be a hotfix or a major/minor release
--git-describe <value>
git-describe is an optional argument expecting an outcome of `git describe` command
--major-version <value>
major-version is required when git-describe option is defined
Examples:
- Some latest tag defined
java -jar release-versioning-assembly-x.y.z.jar --release --git-describe v0.1.0 --major-version 0
- No latest tag defined
java -jar release-versioning-assembly-x.y.z.jar --release
This code is open source software licensed under the Apache 2.0 License.