更新 .github/workflows/build-exe.yml
All checks were successful
Build Windows EXE with Wine / build (push) Successful in 6m28s

This commit is contained in:
2026-03-16 03:44:39 +08:00
Unverified
parent fc1a71dcdd
commit c7bf638f17

View File

@@ -36,9 +36,9 @@ jobs:
sleep 3 # 给虚拟显示器几秒钟的启动时间 sleep 3 # 给虚拟显示器几秒钟的启动时间
# 步骤 3: 下载 Python Windows 安装包 # 步骤 3: 下载 Python Windows 安装包
- name: Download Python 3.9.9 - name: Download Python 3.9.1
run: | run: |
wget https://mirrors.tuna.tsinghua.edu.cn/python/3.9.9/python-3.9.9-amd64.exe -O python-installer.exe wget https://mirrors.tuna.tsinghua.edu.cn/python/3.9.1/python-3.9.1-amd64.exe -O python-installer.exe
ls -lh python-installer.exe ls -lh python-installer.exe
# 步骤 4: 初始化 Wine 环境 # 步骤 4: 初始化 Wine 环境
@@ -48,12 +48,15 @@ jobs:
wineboot -u wineboot -u
# 重要:等待 Wine 后台配置进程完全结束 # 重要:等待 Wine 后台配置进程完全结束
wineserver -w wineserver -w
# 将 Wine 配置为 Windows 10 (Python 3.9+ 强制要求 Win8 以上)
winecfg -v win10
wineserver -w
# 步骤 5: 在 Wine 中安装 Python # 步骤 5: 在 Wine 中安装 Python
- name: Install Python in Wine - name: Install Python in Wine
run: | run: |
# /quiet 表示静默安装 # /quiet 表示静默安装,加入 /log 参数抓取日志以便排错
wine python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 wine python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 /log python-install.log || (cat python-install.log && exit 1)
# 重要:静默安装往往是异步的,必须等待 wineserver 彻底结束,防止 X connection 突然断开 # 重要:静默安装往往是异步的,必须等待 wineserver 彻底结束,防止 X connection 突然断开
wineserver -w wineserver -w
# 安装完后立即删除安装包,释放硬盘 # 安装完后立即删除安装包,释放硬盘