Skip to content
Snippets Groups Projects
Commit 4f123811 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV
Browse files

correcting version bumping in release script

parent ea51bec2
No related branches found
No related tags found
1 merge request!85Correcting release script: sorting tags, corrected version bump, updated help docs
...@@ -154,12 +154,13 @@ def get_parsed_tag(gitpkg, tag): ...@@ -154,12 +154,13 @@ def get_parsed_tag(gitpkg, tag):
raise ValueError( raise ValueError(
'The latest tag name {0} in package {1} has unknown format'.format('v' + latest_tag_name, gitpkg.name)) 'The latest tag name {0} in package {1} has unknown format'.format('v' + latest_tag_name, gitpkg.name))
# increase the version accordingly # increase the version accordingly
major, minor, patch = latest_tag_name.split('.')
if 'major' == tag: # increment the first number in 'v#.#.#' but make minor and patch to be 0 if 'major' == tag: # increment the first number in 'v#.#.#' but make minor and patch to be 0
return 'v' + str(int(latest_tag_name[0]) + 1) + '.0.0' return 'v' + str(int(major) + 1) + '.0.0'
if 'minor' == tag: # increment the second number in 'v#.#.#' but make patch to be 0 if 'minor' == tag: # increment the second number in 'v#.#.#' but make patch to be 0
return 'v' + latest_tag_name[:2] + str(int(latest_tag_name[2]) + 1) + '.0' return 'v' + major + '.' + str(int(minor) + 1) + '.0'
if 'patch' == tag: # increment the last number in 'v#.#.#' if 'patch' == tag: # increment the last number in 'v#.#.#'
return 'v' + latest_tag_name[:-1] + str(int(latest_tag_name[-1]) + 1) return 'v' + major + '.' + minor + '.' + str(int(patch) + 1)
if 'none' == tag: # we do nothing in this case if 'none' == tag: # we do nothing in this case
return tag return tag
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment