Skip to content
Snippets Groups Projects
Commit f80c8367 authored by mjbonifa's avatar mjbonifa
Browse files

(fix) versions now increment from tags with a v prefix but then continue...

(fix) versions now increment from tags with a v prefix but then continue without the v, e.g. if v1.2.1 is the latest tag and we increment the major version the next version will be 2.0.0. closes #56
parent 0bbb8d04
No related branches found
No related tags found
No related merge requests found
...@@ -972,12 +972,14 @@ def _generate_version_tag( ...@@ -972,12 +972,14 @@ def _generate_version_tag(
# Get all valid semantic version tags # Get all valid semantic version tags
versions = [] versions = []
for tag in repo.tags: for tag in repo.tags:
tag_name = ( if tag.name.startswith("v"):
tag.name.lstrip("v") if use_v_prefix else tag.name tag_name = tag.name[1:] # Remove the first character
) # Remove 'v' if needed else:
tag_name = tag.name
if semver.Version.is_valid(tag_name): if semver.Version.is_valid(tag_name):
versions.append(semver.Version.parse(tag_name)) versions.append(semver.Version.parse(tag_name))
_logger.debug(f"Versions: {versions}")
# Determine the next version # Determine the next version
if not versions: if not versions:
new_version = semver.Version(0, 0, 1) new_version = semver.Version(0, 0, 1)
......
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