diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb2d79c..23664e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,6 @@ jobs: - name: Archive release files run: | - mkdir -p dist Compress-Archive -Path dist\* -DestinationPath release-windows.zip - name: Upload release artifact diff --git a/buildup.py b/buildup.py index 012bd7d..52f2a37 100644 --- a/buildup.py +++ b/buildup.py @@ -4,6 +4,12 @@ import codecs import os +# 安装Pyinstaller及主程序依赖 +# 必须在import项目中的模块之前执行,否则会出现找不到模块的错误 +print("Installing dependencies...") +subprocess.run("pip install -r requirements.txt", shell=True) +subprocess.run("pip install pyinstaller", shell=True) + from mod.args import GlobalArgs sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) @@ -19,11 +25,6 @@ APP_VERSION = GlobalArgs().version PACK_NAME = f"{APP_NAME}-{APP_VERSION}-{PLATFORM}-{ARCHITECTURE}{'.exe' if PLATFORM == 'Windows' else ''}" -# 安装Pyinstaller及主程序依赖 -subprocess.run("pip install -r requirements.txt", shell=True) -subprocess.run("pip install pyinstaller", shell=True) - - # 打包 def generate_add_data_options(root_dir): options = []