Adding to your project
Add the following line to your
addSbtPlugin("me.pdalpra" % "sbt-autoversion" % "2.0.0")
sbt-autoversion automatically wires itself in the setting of sbt-release's
releaseVersion setting, meaning that you can use the sbt-release's
release with-defaults command and use the non-interactive release process with the correct version configured.
sbt-autoversion however expose a few interesting tasks:
latestTag: fetches the latest Git tag, based on Semantic Versioning ordering
unreleasedCommits: lists commits since the latest tag/release
suggestedBump: shows what version bump the plugin has computed and would automatically apply on the next release.
Linked to sbt-release's
releaseTagName setting, defines how to "clean up" a Git tag to get back a semver-compatible version.
The list of regular expression that a commit message should match to be seen as requiring respectively a major, a minor, or a bugfix version bump.
Note: regular expressions are executed in the order shown above (major, minor, then bugfix) and the first match is returned. See
defaultBump for behavior if no matches are found in the unreleased commit messages.
If the plugin is unable to suggest a version bump based on commit messages (i.e., if none of the configured regular expressions match), this version bump will be suggested instead. If set to
None, an error will be thrown, and the release will be aborted.
Some(Bump.Bugfix) by default.
This software is under the Apache 2.0 License.