From 9cf6198cbf0baea77e94ad1f471f6f99c0a5165a Mon Sep 17 00:00:00 2001 From: miu <205594122@qq.com> Date: Sun, 15 Mar 2026 19:05:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.github/workflows/build-ex?= =?UTF-8?q?e.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-exe.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-exe.yml b/.github/workflows/build-exe.yml index adb50d2..d652709 100644 --- a/.github/workflows/build-exe.yml +++ b/.github/workflows/build-exe.yml @@ -15,11 +15,26 @@ jobs: # 验证文件完整性 file python-3.9.9-amd64.exe - # 步骤2:先测试 Wine 能否运行简单命令 - - name: Test Wine environment + - name: Reset Wine environment (clean slate) 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 - xvfb-run wine cmd /c "echo Wine is working" + xvfb-run wine cmd /c "echo Wine environment is ready" # 步骤3:安装 Python(使用正确的文件名) - name: Install Python in Wine