更新 .github/workflows/build-exe.yml
Some checks failed
Build Windows EXE with Full Image / build (push) Failing after 1m18s

This commit is contained in:
miu
2026-03-15 19:05:13 +08:00
Unverified
parent 43868f576e
commit 9cf6198cbf

View File

@@ -15,11 +15,26 @@ jobs:
# 验证文件完整性 # 验证文件完整性
file python-3.9.9-amd64.exe file python-3.9.9-amd64.exe
# 步骤2先测试 Wine 能否运行简单命令 - name: Reset Wine environment (clean slate)
- name: Test Wine environment
run: | run: |
echo "=== 备份并删除旧的 Wine 配置目录 ==="
# 如果 ~/.wine 目录存在,先重命名备份(或直接删除)
if [ -d "$HOME/.wine" ]; then
mv "$HOME/.wine" "$HOME/.wine.bak.$(date +%s)"
echo "Old .wine directory backed up."
fi
echo "=== 初始化一个新的干净的Wine环境 ==="
# 初始化Wine环境使用 xvfb-run 避免任何图形界面问题
# 设置 WINEARCH 为 win64 以支持64位
export WINEARCH=win64
xvfb-run wineboot -u
echo "=== 验证新环境 ==="
# 等待几秒让环境初始化完成
sleep 5
wine --version wine --version
xvfb-run wine cmd /c "echo Wine is working" xvfb-run wine cmd /c "echo Wine environment is ready"
# 步骤3安装 Python使用正确的文件名 # 步骤3安装 Python使用正确的文件名
- name: Install Python in Wine - name: Install Python in Wine