From 6b059c3e14f158fada486d98f3ae04da92e3a36e Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Thu, 29 Dec 2022 17:26:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=95=E8=AF=95py=20os.system=20?= =?UTF-8?q?=E8=83=BD=E4=B8=8D=E8=83=BD=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/after_compile.py | 8 ++++++-- .github/workflows/get_info.py | 4 ++++ .github/workflows/nuitka.yml | 6 ++++-- Difficult_Rocket/__init__.py | 3 ++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/after_compile.py b/.github/workflows/after_compile.py index 06e1a4d..ec352ac 100644 --- a/.github/workflows/after_compile.py +++ b/.github/workflows/after_compile.py @@ -5,12 +5,16 @@ # ------------------------------- import os +import sys import zipfile -print(os.listdir('../../build')) +if sys.platform == "win32": + os.system('') + +print(os.listdir('./build')) with zipfile.ZipFile('./build/main.zip', 'w', zipfile.ZIP_DEFLATED, compresslevel=9) as dist_zip: - for path, sub_paths, sub_files in os.walk('../../build/DR.dist'): + for path, sub_paths, sub_files in os.walk('./build/DR.dist'): print(f'writing {path}') for file in sub_files: file_path = os.path.join(path, file) diff --git a/.github/workflows/get_info.py b/.github/workflows/get_info.py index ccbcea9..a9b71f5 100644 --- a/.github/workflows/get_info.py +++ b/.github/workflows/get_info.py @@ -7,7 +7,11 @@ import os import sys +from Difficult_Rocket import DR_runtime + print(os.curdir) print(os.listdir('.')) print(sys.path) +os.system(f'echo "DR_version={DR_runtime.DR_version.__str__()}" >> $GITHUB_OUTPUT') + diff --git a/.github/workflows/nuitka.yml b/.github/workflows/nuitka.yml index b684fcc..9cd6ad2 100644 --- a/.github/workflows/nuitka.yml +++ b/.github/workflows/nuitka.yml @@ -81,7 +81,7 @@ jobs: $arg += @("--include-data-dir=./libs/fonts=./libs/fonts") $arg += @("--include-data-dir=./textures=./textures") $arg += @("--include-data-dir=./configs=./configs") - $arg += @("--show-progress") + # $arg += @("--show-progress") $arg += @("--assume-yes-for-download") python -m nuitka $arg DR.py @@ -90,7 +90,8 @@ jobs: shell: bash run: | arg="--standalone --assume-yes-for-download --output-dir=build " - arg+="--clang --lto=no --show-progress " + # arg+="--show-progress " + arg+="--clang --lto=no " arg+="--nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet " arg+="--include-data-dir=./libs/pyglet=./pyglet " arg+="--include-data-dir=./libs/fonts=./libs/fonts " @@ -99,6 +100,7 @@ jobs: python -m nuitka $arg DR.py - name: after build + shell: pwsh run: python ./.github/workflows/after_compile.py # Uploads artifact diff --git a/Difficult_Rocket/__init__.py b/Difficult_Rocket/__init__.py index 5ed1849..0df7664 100644 --- a/Difficult_Rocket/__init__.py +++ b/Difficult_Rocket/__init__.py @@ -20,11 +20,12 @@ from libs.MCDR.version import Version game_version = Version("0.6.4") __version__ = game_version -long_version: ctypes.c_longlong = ctypes.c_longlong(2) +long_version: ctypes.c_longlong = ctypes.c_longlong(3) """ long_version: 一个用于标记内部协议的整数 1: 我可算想起来还有这回事了 v0.6.4 2: 哦,对 longlong 好耶! +3: 就是试试改一下,正好 compiler 要用 """