mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-30 06:11:09 -07:00
temporary fix for external PR
This commit is contained in:
parent
03c6686f7d
commit
e59aa8e22b
1 changed files with 32 additions and 28 deletions
60
.github/workflows/conan-recipe-version.yml
vendored
60
.github/workflows/conan-recipe-version.yml
vendored
|
|
@ -130,36 +130,40 @@ jobs:
|
||||||
latest_branch_version = version
|
latest_branch_version = version
|
||||||
latest_branch_tag = repo.tag(tag)
|
latest_branch_tag = repo.tag(tag)
|
||||||
|
|
||||||
# %% Get the actual version
|
if latest_branch_tag:
|
||||||
no_commits = 0
|
# %% Get the actual version
|
||||||
for commit in repo.iter_commits("HEAD"):
|
no_commits = 0
|
||||||
if commit == latest_branch_tag.commit:
|
for commit in repo.iter_commits("HEAD"):
|
||||||
break
|
if commit == latest_branch_tag.commit:
|
||||||
no_commits += 1
|
break
|
||||||
|
no_commits += 1
|
||||||
if no_commits == 0:
|
|
||||||
# This is a release
|
if no_commits == 0:
|
||||||
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}"
|
# This is a release
|
||||||
if channel == "stable":
|
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}"
|
||||||
user = "_"
|
if channel == "stable":
|
||||||
channel = "_"
|
user = "_"
|
||||||
else:
|
channel = "_"
|
||||||
if latest_branch_version.prerelease and not "." in latest_branch_version.prerelease:
|
|
||||||
# The prerealese did not contain a version number, default it to 1
|
|
||||||
latest_branch_version.prerelease += ".1"
|
|
||||||
if event_name == "pull_request":
|
|
||||||
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}pr_{issue_number}_{no_commits}"
|
|
||||||
else:
|
else:
|
||||||
if channel in ("stable", "_", ""):
|
if latest_branch_version.prerelease and not "." in latest_branch_version.prerelease:
|
||||||
channel_metadata = f"{no_commits}"
|
# The prerealese did not contain a version number, default it to 1
|
||||||
|
latest_branch_version.prerelease += ".1"
|
||||||
|
if event_name == "pull_request":
|
||||||
|
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}pr_{issue_number}_{no_commits}"
|
||||||
else:
|
else:
|
||||||
channel_metadata = f"{channel}_{no_commits}"
|
if channel in ("stable", "_", ""):
|
||||||
# FIXME: for when we create a new release branch
|
channel_metadata = f"{no_commits}"
|
||||||
if latest_branch_version.prerelease == "":
|
else:
|
||||||
bump_up_minor = int(latest_branch_version.minor) + 1
|
channel_metadata = f"{channel}_{no_commits}"
|
||||||
actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{latest_branch_version.patch}-alpha+{buildmetadata}{channel_metadata}"
|
# FIXME: for when we create a new release branch
|
||||||
else:
|
if latest_branch_version.prerelease == "":
|
||||||
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}{channel_metadata}"
|
bump_up_minor = int(latest_branch_version.minor) + 1
|
||||||
|
actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{latest_branch_version.patch}-alpha+{buildmetadata}{channel_metadata}"
|
||||||
|
else:
|
||||||
|
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}{channel_metadata}"
|
||||||
|
else:
|
||||||
|
# FIXME: for external PR's
|
||||||
|
actual_version = f"5.2.0-alpha+{buildmetadata}pr_{issue_number}_{no_commits}"
|
||||||
|
|
||||||
# %% print to output
|
# %% print to output
|
||||||
cmd_name = ["echo", f"::set-output name=name::{project_name}"]
|
cmd_name = ["echo", f"::set-output name=name::{project_name}"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue