display info in github action
This commit is contained in:
parent
7c8721db11
commit
25b922cc58
14
.github/workflows/get_info.py
vendored
14
.github/workflows/get_info.py
vendored
@ -12,15 +12,19 @@ import io
|
|||||||
|
|
||||||
sys.path.append(os.path.abspath(os.curdir))
|
sys.path.append(os.path.abspath(os.curdir))
|
||||||
|
|
||||||
try:
|
is_github = "-github" in sys.argv
|
||||||
|
|
||||||
|
if is_github:
|
||||||
stdout = sys.stdout
|
stdout = sys.stdout
|
||||||
sys.stdout = io.StringIO()
|
sys.stdout = io.StringIO()
|
||||||
|
|
||||||
|
try:
|
||||||
from Difficult_Rocket import DR_status
|
from Difficult_Rocket import DR_status
|
||||||
sys.stdout = stdout
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
args = ["-env", "-github-dev"]
|
if is_github:
|
||||||
|
sys.stdout = stdout
|
||||||
|
|
||||||
|
|
||||||
if sys.argv == [__file__]: # 没有输入参数,直接输出默认信息并输出
|
if sys.argv == [__file__]: # 没有输入参数,直接输出默认信息并输出
|
||||||
@ -33,10 +37,6 @@ if sys.argv == [__file__]: # 没有输入参数,直接输出默认信息并
|
|||||||
config_file["window"]["height"] = 768
|
config_file["window"]["height"] = 768
|
||||||
rtoml.dump(config_file, open("./config/main.toml", "w"))
|
rtoml.dump(config_file, open("./config/main.toml", "w"))
|
||||||
|
|
||||||
elif os.path.abspath(os.curdir) in sys.path and "-env" in sys.argv:
|
|
||||||
with open("./.github/workflows/env.ps1", encoding="utf-8", mode="w") as env_file:
|
|
||||||
print(f'$env:DR_version = "{DR_status.DR_version}"', file=env_file)
|
|
||||||
print(f'$env:Build_version = "{DR_status.Build_version}"', file=env_file)
|
|
||||||
elif os.path.abspath(os.curdir) in sys.path and "-github" in sys.argv:
|
elif os.path.abspath(os.curdir) in sys.path and "-github" in sys.argv:
|
||||||
print(f"DR_version={DR_status.DR_version}")
|
print(f"DR_version={DR_status.DR_version}")
|
||||||
print(f"Build_version={DR_status.Build_version}")
|
print(f"Build_version={DR_status.Build_version}")
|
||||||
|
Loading…
Reference in New Issue
Block a user