reset the count from the branching of commit

This commit is contained in:
jspijker 2023-02-01 10:35:26 +01:00
parent e7d7a23be8
commit 4ef6af26df

View file

@ -170,17 +170,18 @@ jobs:
bump_up_release_tag = int(latest_branch_version.prerelease.split('.')[1]) + 1
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.split('.')[0]}.{bump_up_release_tag}+{buildmetadata}{channel_metadata}"
else:
branches_version = []
max_branches_version = tools.Version("0.0.0")
branches_no_commits = no_commits
for branch in repo.references:
try:
if "remotes/origin" in branch.abspath:
b_version = tools.Version(branch.name)
if b_version < tools.Version("10.0.0"):
branches_version.append(b_version)
if b_version < tools.Version("10.0.0") and b_version > max_branches_version:
max_branches_version = b_version
branches_no_commits = repo.commit().count() - branch..commit.count()
except:
pass
latest_branches_version = max(sorted(branches_version))
if latest_branches_version > latest_branch_version:
if max_branches_version > latest_branch_version:
actual_version = f"{latest_branches_version.major}.{int(latest_branches_version.minor) + 1}.0-alpha+{buildmetadata}{channel_metadata}"
else:
actual_version = f"{latest_branch_version.major}.{int(latest_branch_version.minor) + 1}.0-alpha+{buildmetadata}{channel_metadata}"