mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 14:19:00 +08:00
write directly to the env file
This commit is contained in:
parent
be0b2b15c7
commit
87cea8f8f4
32
.github/workflows/conan-recipe-version.yml
vendored
32
.github/workflows/conan-recipe-version.yml
vendored
@ -85,6 +85,7 @@ jobs:
|
|||||||
name: Get Conan broadcast data
|
name: Get Conan broadcast data
|
||||||
run: |
|
run: |
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
from conans import tools
|
from conans import tools
|
||||||
from conans.errors import ConanException
|
from conans.errors import ConanException
|
||||||
from git import Repo
|
from git import Repo
|
||||||
@ -170,21 +171,22 @@ jobs:
|
|||||||
reset_patch = 0
|
reset_patch = 0
|
||||||
actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{reset_patch}-alpha+{buildmetadata}{channel_metadata}"
|
actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{reset_patch}-alpha+{buildmetadata}{channel_metadata}"
|
||||||
|
|
||||||
# %% print to output
|
# %% Set the environment output
|
||||||
cmd_name = ["echo", f"\"name={project_name}\" >> $GITHUB_OUTPUT"]
|
output_env = os.environ["GITHUB_OUTPUT"]
|
||||||
subprocess.call(cmd_name)
|
content = ""
|
||||||
cmd_version = ["echo", f"\"version={actual_version}\" >> $GITHUB_OUTPUT"]
|
if os.path.exist(output_env):
|
||||||
subprocess.call(cmd_version)
|
with open(output_env, "r") as f:
|
||||||
cmd_channel = ["echo", f"\"channel={channel}\" >> $GITHUB_OUTPUT"]
|
content = f.read()
|
||||||
subprocess.call(cmd_channel)
|
|
||||||
cmd_id_full= ["echo", f"\"recipe_id_full={project_name}/{actual_version}@{user}/{channel}\" >> $GITHUB_OUTPUT"]
|
with open(output_env, "w") as f:
|
||||||
subprocess.call(cmd_id_full)
|
f.write(content)
|
||||||
cmd_id_latest = ["echo", f"\"recipe_id_latest={project_name}/latest@{user}/{channel}\" >> $GITHUB_OUTPUT"]
|
f.writelines(f"name={project_name}\n")
|
||||||
subprocess.call(cmd_id_latest)
|
f.writelines(f"version={actual_version}\n")
|
||||||
cmd_semver_full = ["echo", f"\"semver_full={actual_version}\" >> $GITHUB_OUTPUT"]
|
f.writelines(f"channel={channel}\n")
|
||||||
subprocess.call(cmd_semver_full)
|
f.writelines(f"recipe_id_full={project_name}/{actual_version}@{user}/{channel}\n")
|
||||||
cmd_is_release_branch = ["echo", f"\"is_release_branch={str(is_release_branch).lower()}\" >> $GITHUB_OUTPUT"]
|
f.writelines(f"recipe_id_latest={project_name}/latest@{user}/{channel}\n")
|
||||||
subprocess.call(cmd_is_release_branch)
|
f.writelines(f"semver_full={actual_version}\n")
|
||||||
|
f.writelines(f"is_release_branch={str(is_release_branch).lower()}\n")
|
||||||
|
|
||||||
print("::group::Conan Recipe Information")
|
print("::group::Conan Recipe Information")
|
||||||
print(f"name = {project_name}")
|
print(f"name = {project_name}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user