mix version (mix_version v2.5.0)
View SourceThis module implements a mix task whose main purpose is to update the version number of an Elixir application, with extra steps such as committing a git tag.
Configuration
Configuration can be provided under :versioning
from the project/0
callback
of the project file:
# in mix.exs
def project do
[
app: :my_app,
version: "1.2.3",
# ...
versioning: versioning()
]
end
defp versioning do
[
annotate: true,
annotation: "new version %s",
commit_msg: "new version %s",
tag_prefix: "v"
]
end
In the commit message and annotation, any occurence of %s
will be replaced by
the new version number. The presence of %s
is not mandatory.
This configuration is totally optional. The sample values above are the default
values used by mix version
.
Configuration can be overriden by command line options. For instance, if
:annotate
is set to false
in configuration, you can use the --annotate
CLI
flag to force it to be true
.
Synopsis
mix version [options]
Options
-i, --info
- Only outputs the current version and stops. Ignores all other options. Defaults tofalse
.-M, --major
- Bump to a new major version. Defaults tofalse
.-m, --minor
- Bump to a new minor version. Defaults tofalse
.-p, --patch
- Bump the patch version. Defaults tofalse
.-n, --new-version <string>
- Set the new version number. Defaults tonil
.-a, --annotate
- Create an annotated git tag. Defaults is pulled frommix.exs
with fallback totrue
.-c, --commit-msg <string>
- Define the commit message, with all '%s' replaced by the new VSN. Defaults is pulled frommix.exs
with fallback to"new version %s"
.-A, --annotation <string>
- Define the tag annotation message, with all '%s' replaced by the new VSN. Defaults is pulled frommix.exs
with fallback to"new version %s"
.-x, --tag-prefix <string>
- Define the tag prefix. Defaults is pulled frommix.exs
with fallback to"v"
.-k, --tag-current
- Commit and tag with the current version. Defaults tofalse
.--help
- Displays this help.