Merge remote-tracking branch 'origin/main' into CURA-10317_other_inconsitent_material_profiles_in_internal_builds

This commit is contained in:
jspijker 2023-02-27 11:52:07 +01:00
commit ac618b7b9e

View File

@ -91,8 +91,8 @@ jobs:
run: | run: |
import subprocess import subprocess
import os import os
from conans import tools from conan.tools.scm import Version
from conans.errors import ConanException from conan.errors import ConanException
from git import Repo from git import Repo
repo = Repo('.') repo = Repo('.')
@ -108,16 +108,16 @@ jobs:
# FIXME: for when we push a tag (such as an release) # FIXME: for when we push a tag (such as an release)
channel = "testing" channel = "testing"
if is_tag: if is_tag:
branch_version = tools.Version(ref_name) branch_version = Version(ref_name)
is_release_branch = True is_release_branch = True
channel = "_" channel = "_"
user = "_" user = "_"
actual_version = f"{branch_version}" actual_version = f"{branch_version}"
else: else:
try: try:
branch_version = tools.Version(repo.active_branch.name) branch_version = Version(repo.active_branch.name)
except ConanException: except ConanException:
branch_version = tools.Version('0.0.0') branch_version = Version('0.0.0')
if ref_name == f"{branch_version.major}.{branch_version.minor}": if ref_name == f"{branch_version.major}.{branch_version.minor}":
channel = 'stable' channel = 'stable'
is_release_branch = True is_release_branch = True
@ -130,16 +130,16 @@ jobs:
channel = f"pr_{issue_number}" channel = f"pr_{issue_number}"
# %% Get the actual version # %% Get the actual version
latest_branch_version = tools.Version("0.0.0") latest_branch_version = Version("0.0.0")
latest_branch_tag = None latest_branch_tag = None
for tag in repo.git.tag(merged = True).splitlines(): for tag in repo.git.tag(merged = True).splitlines():
if str(tag).startswith("firmware") or str(tag).startswith("master"): if str(tag).startswith("firmware") or str(tag).startswith("master"):
continue # Quick-fix for the versioning scheme name of the embedded team in fdm_materials(_private) repo continue # Quick-fix for the versioning scheme name of the embedded team in fdm_materials(_private) repo
try: try:
version = tools.Version(tag) version = Version(tag)
except ConanException: except ConanException:
continue continue
if version > latest_branch_version and version < tools.Version("10.0.0"): if version > latest_branch_version and version < Version("10.0.0"):
# FIXME: stupid old Cura tags 13.04 etc. keep popping up # FIXME: stupid old Cura tags 13.04 etc. keep popping up
latest_branch_version = version latest_branch_version = version
latest_branch_tag = repo.tag(tag) latest_branch_tag = repo.tag(tag)
@ -175,13 +175,13 @@ jobs:
bump_up_release_tag = int(latest_branch_version.prerelease.split('.')[1]) + 1 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}" 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: else:
max_branches_version = tools.Version("0.0.0") max_branches_version = Version("0.0.0")
branches_no_commits = no_commits branches_no_commits = no_commits
for branch in repo.references: for branch in repo.references:
try: try:
if "remotes/origin" in branch.abspath: if "remotes/origin" in branch.abspath:
b_version = tools.Version(branch.name.split("/")[-1]) b_version = Version(branch.name.split("/")[-1])
if b_version < tools.Version("10.0.0") and b_version > max_branches_version: if b_version < Version("10.0.0") and b_version > max_branches_version:
max_branches_version = b_version max_branches_version = b_version
branches_no_commits = repo.commit().count() - branch.commit.count() branches_no_commits = repo.commit().count() - branch.commit.count()
except: except: