-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Welcome to the auto-semver wiki!
-
Run pip install on the file.
pip install auto-semver1.0.8.tar.gz
-
Validate your install was successful
semver -h
The semver
command runs auto-semver.
The exit code of auto-semver determines the output.
Exit codes:
Value | Meaning |
---|---|
0 | Successfully ran auto-semver |
1 | No merge found |
2 | Not a main branch |
3 | No git flow branch name found |
128 | Unknown error occured |
-n
Does not push after versioning.
-h
Shows helps screen.
The semver_get_version
command returns the version number if the semver
command exited 0
. If semver
exited anything else, semver_get_version
will return the branch name.
-d
Replaces /
with .
in branch names. For example, feature/test
becomes feature.test
The .bumpversion.cfg
file determines auto-semver's output and how it interacts with other files.
The [bumpversion]
section has values that determines the current version and how bumpversion interacts with Git.
Any [bumpversion:file:*]
section is for a file in which bumpversion will keep a copy of the version.
See more on how bumpversion works on GitHub
The [semver]
section has keys corresponding to branches that determine versioning.
The main_branches
are the branches in which versioning takes places.
The major_branches
determine the first number in the version. (x in x.0.0)
The minor_branches
determine the second number in the version. (x in 0.x.0)
The patch_branches
determine the last number in the version. (x in 0.0.x)
Example .bumpversion.cfg:
[bumpversion]
current_version = 0.0.0
commit = True
tag = True
tag_name = {new_version}
message = Bump version: {current_version} -> {new_version}
[bumpversion:file:VERSION]
search = __version__ = {current_version}
replace = __version__ = {new_version}
[semver]
main_branches = develop
major_branches =
minor_branches = feature
patch_branches = bugfix, hotfix
Example VERSION:
__version__ = 0.0.0