37 Commits
Author SHA1 Message Date
Hsdi c7bf638f17 更新 .github/workflows/build-exe.yml 2026-03-16 03:44:39 +08:00
Hsdi fc1a71dcdd 更新 .github/workflows/build-exe.yml 2026-03-16 03:39:16 +08:00
Hsdi 61930b49d7 更新 .github/workflows/build-exe.yml 2026-03-16 03:35:03 +08:00
Hsdi a4f286f55a 更新 .github/workflows/build-exe.yml 2026-03-16 03:31:56 +08:00
Hsdi b94754f827 更新 .github/workflows/build-exe.yml 2026-03-16 03:30:51 +08:00
Hsdi e671c9402f 更新Xvfb 2026-03-16 03:29:16 +08:00
Hsdi 4b4e527c3e 切换纽约 2026-03-16 03:24:32 +08:00
Hsdi 2f79e2dda0 重新运行
Build Windows EXE with Full Image / build (push) Failing after 5m58s
2026-03-16 00:54:11 +08:00
Hsdi aa678894b0 Merge pull request '更新 .github/workflows/build-exe-Miu.yml' (#7) from DreamMiu/Shortcut_Sync_PotPlayer:main into main
Reviewed-on: Hsdi/Shortcut_Sync_PotPlayer#7
Reviewed-by: miu <205594122@qq.com>
2026-03-16 00:39:40 +08:00
miu c1cda62bb5 revert 65e9670a78
Build Windows EXE with Full Image / build (push) Failing after 13s
revert Merge branch 'main' into main
2026-03-16 00:34:35 +08:00
miu 65e9670a78 Merge branch 'main' into main 2026-03-16 00:32:52 +08:00
Hsdi c7918a7492 Merge branch 'Miu' 2026-03-16 00:11:44 +08:00
Hsdi 0152340b65 Merge branch 'main' into Miu 2026-03-16 00:10:12 +08:00
Hsdi 8a13a098da Merge branch 'main' of https://git.hsdi.cc/Hsdi/Shortcut_Sync_PotPlayer 2026-03-15 23:51:38 +08:00
Hsdi 3646908a00 删除冗余的构建工作流文件 build-exe.yml 和 build-exe-Miu.yml 2026-03-15 23:51:22 +08:00
Hsdi 07c586c1d5 删除 .github/workflows/build-exe.yml 2026-03-15 23:49:27 +08:00
Hsdi 8022a69d61 Merge branch 'main' of https://git.hsdi.cc/Hsdi/Shortcut_Sync_PotPlayer 2026-03-15 23:46:13 +08:00
Hsdi dc264f249b fix: 保留 build-exe.yml 自动化工作流 2026-03-15 23:46:04 +08:00
miu cb555293e4 更新 .github/workflows/build-exe-Miu.yml
Build Windows EXE with Full Image / build (push) Failing after 2m49s
解决冲突

Signed-off-by: miu <205594122@qq.com>
2026-03-15 23:42:10 +08:00
miu 233ceaca2e 更新 .github/workflows/build-exe-Miu.yml
Build Windows EXE with Full Image / build (push) Failing after 2m53s
解决冲突

Signed-off-by: miu <205594122@qq.com>
2026-03-15 23:23:30 +08:00
miu b4dd7492c2 更新 .github/workflows/build-exe.yml
Build Windows EXE with Full Image / build (push) Successful in 2m53s
v1.0
2026-03-15 22:59:39 +08:00
miu f915340969 更新 .github/workflows/build-exe.yml
v1.0
2026-03-15 22:57:59 +08:00
miu 9eb173bdfc 更新 .github/workflows/build-exe.yml
Build Windows EXE with Full Image / build (push) Successful in 2m54s
发布 v1.0

Signed-off-by: miu <205594122@qq.com>
2026-03-15 22:54:33 +08:00
Hsdi d4627c8aba 3151227 2026-03-15 12:27:15 +08:00
Hsdi e59bc51fca 3151223 2026-03-15 12:23:41 +08:00
Hsdi 14e49f1b19 3151150 2026-03-15 11:51:04 +08:00
Hsdi 7f7c172abb 修改工作流 2026-03-15 11:32:35 +08:00
Hsdi 479fc155f7 重新构建代码 2026-03-15 11:15:17 +08:00
Hsdi 4973716368 重构构建工作流 2026-03-15 04:02:31 +08:00
Hsdi 38c3bf33ab 更新构建工作流,优化Python安装和仓库克隆步骤 2026-03-15 03:52:27 +08:00
Hsdi 84de76c853 移除构建作业中的全局组设置 2026-03-15 03:36:40 +08:00
Hsdi 87f8a4cd91 Merge branch 'main' of https://git.hsdi.cc/Hsdi/Shortcut_Sync_PotPlayer 2026-03-15 03:24:19 +08:00
Hsdi cf93a1ce59 删除 .github/workflows/build-exe.yml 2026-03-15 03:05:46 +08:00
miu 789b02ee27 更新 .github/workflows/build-exe.yml 2026-03-15 03:03:16 +08:00
miu 18b5ba9c43 更新 .github/workflows/build-exe.yml 2026-03-15 02:55:44 +08:00
miu 190a08805b 更新 .github/workflows/build-exe.yml 2026-03-15 02:54:15 +08:00
miu e85e2c7aa9 更新 .github/workflows/build-exe.yml
fix
2026-03-15 02:44:53 +08:00
+87 -87
View File
@@ -1,109 +1,109 @@
name: Build Windows EXE with Full Image
on: [push]
name: Build Windows EXE with Wine
on:
push:
tags:
- 'v*'
branches: ["main"]
jobs:
build:
runs-on: Ubuntu_docker_act
runs-on: ubuntu-latest
# 设定全局环境变量,这些变量在所有 steps 中都生效
env:
WINEARCH: win64
WINEPREFIX: /root/.wine
WINEDEBUG: -all # 屏蔽无用的警告日志 (如 missing Gecko)
DISPLAY: :99 # 统一使用 99 号虚拟显示器
steps:
- uses: actions/checkout@v4
- name: Checkout Code
uses: actions/checkout@v4
# 步骤1:下载 Python 3.9.9 安装包(保持文件名一致)
- name: Download Python 3.9.9 installer
# 步骤 1: 安装必要依赖
- name: Install System Dependencies
run: |
wget https://mirrors.tuna.tsinghua.edu.cn/python/3.9.9/python-3.9.9-amd64.exe
ls -lh python-3.9.9-amd64.exe
# 验证文件完整性
file python-3.9.9-amd64.exe
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y xvfb wine64 wine32 wine binutils
sudo apt-get clean # 及时清理 apt 缓存节省硬盘空间
- name: Reset Wine environment (clean slate)
# 步骤 2: 在后台持续运行 Xvfb
- name: Start Xvfb
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 environment is ready"
# 步骤3:安装 Python(使用正确的文件名)
# 启动 X 虚拟屏幕并放到后台,供整个工作流期间的 Wine 使用
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 3 # 给虚拟显示器几秒钟的启动时间
# 步骤 3: 下载 Python Windows 安装包
- name: Download Python 3.9.1
run: |
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
# 步骤 4: 初始化 Wine 环境
- name: Setup Wine Environment
run: |
# 初始化 Wine,不再使用 xvfb-run
wineboot -u
# 重要:等待 Wine 后台配置进程完全结束
wineserver -w
# 将 Wine 配置为 Windows 10 (Python 3.9+ 强制要求 Win8 以上)
winecfg -v win10
wineserver -w
# 步骤 5: 在 Wine 中安装 Python
- name: Install Python in Wine
run: |
echo "Current directory: $(pwd)"
ls -lah
# /quiet 表示静默安装,加入 /log 参数抓取日志以便排错
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 -w
# 安装完后立即删除安装包,释放硬盘
rm python-installer.exe
if [ ! -f python-3.9.9-amd64.exe ]; then
echo "Installer not found!"
# 步骤 6: 验证并定位 Python 路径
- name: Verify Python Path
run: |
# 动态查找 python.exe 路径并存入环境变量
PYTHON_PATH=$(find $WINEPREFIX/drive_c -name "python.exe" | head -n 1)
if [ -z "$PYTHON_PATH" ]; then
echo "Python installation failed!"
exit 1
fi
echo "PYTHON_EXE=$PYTHON_PATH" >> $GITHUB_ENV
echo "Found Python at: $PYTHON_PATH"
wine "$PYTHON_PATH" --version
# 直接用 wine 运行
xvfb-run -a wine python-3.9.9-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
# 等待安装
sleep 20
# 步骤4:更彻底地查找 Python
- name: Find and verify Python
# 步骤 7: 安装 Python 依赖
- name: Install Pip Dependencies
run: |
echo "=== Searching all possible Python locations ==="
# 查找所有 python.exe
find /root/.wine/drive_c -name "python.exe" 2>/dev/null | while read path; do
echo "Found: $path"
echo "Version info:"
wine "$path" --version 2>/dev/null || echo "Cannot run $path"
done
# 尝试常见路径
COMMON_PATHS=(
"/root/.wine/drive_c/Python39/python.exe"
"/root/.wine/drive_c/Python39-32/python.exe"
"/root/.wine/drive_c/Program Files/Python39/python.exe"
"/root/.wine/drive_c/users/runner/AppData/Local/Programs/Python/Python39/python.exe"
)
for path in "${COMMON_PATHS[@]}"; do
if [ -f "$path" ]; then
echo "Found Python at standard location: $path"
PYTHON_EXE="$path"
break
fi
done
if [ -z "$PYTHON_EXE" ]; then
echo "Python not found in standard locations"
exit 1
fi
echo "PYTHON_EXE=$PYTHON_EXE" >> $GITHUB_ENV
wine "$PYTHON_EXE" --version
# 使用清华源加速
wine "$PYTHON_EXE" -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
wine "$PYTHON_EXE" -m pip install pyinstaller keyboard pywin32 -i https://pypi.tuna.tsinghua.edu.cn/simple
wineserver -w
# 步骤5:安装依赖
- name: Install dependencies
run: |
# 升级 pip
wine "$PYTHON_EXE" -m pip install --upgrade pip
# 安装包
wine "$PYTHON_EXE" -m pip install pyinstaller keyboard pywin32
# 步骤6:构建 EXE
# 步骤 8: 执行 PyInstaller 构建
- name: Build EXE
run: |
wine "$PYTHON_EXE" -m PyInstaller --onefile --windowed --name Shortcut_Sync_PotPlayer main.py
# --clean 参数可以在构建前清理临时文件
wine "$PYTHON_EXE" -m PyInstaller --onefile --windowed --clean --name Shortcut_Sync_PotPlayer main.py
wineserver -w
# 步骤7:上传构建产物(修复版本
# 步骤 9: 上传 Artifact (Gitea 专用版本)
- name: Upload Artifact
uses: christopherhx/gitea-upload-artifact@v4 # 关键修复!
uses: christopherhx/gitea-upload-artifact@v4
with:
name: Shortcut_Sync_PotPlayer
path: dist/Shortcut_Sync_PotPlayer.exe
path: dist/Shortcut_Sync_PotPlayer.exe
# 步骤 10: 发布 Release (仅在推送 tag 时执行)
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: https://gitea.com/actions/release-action@main
with:
files: dist/Shortcut_Sync_PotPlayer.exe
api_key: '${{ secrets.GITHUB_TOKEN }}'
name: 'Release ${{ github.ref_name }}'
draft: false
prerelease: false