20 Commits

View File

@@ -1,38 +1,35 @@
name: Build Windows EXE
on:
push:
branches: [ "main" ]
workflow_dispatch: # 允许手动触发
name: Build Windows EXE with Full Image
on: [push]
jobs:
build:
runs-on: windows-latest
runs-on: Ubuntu_docker_act
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9.1' # 建议指定版本,确保稳定性
cache: 'pip' # 自动缓存依赖,加快下次构建速度
- name: Install dependencies
- name: Wine
run: |
python -m pip install --upgrade pip
python -m pip install pyinstaller keyboard pywin32
- name: Build with PyInstaller
wine --version # 安装后验证
- name: Install Windows dependencies using Wine Python
run: |
# --clean 确保清理旧缓存
# --admin-access 如果你的程序需要监听全局钩子,有时需要此权限
python -m PyInstaller --noconfirm --onefile --windowed --name "Shortcut_Sync_PotPlayer" main.py
# 使用 Wine 运行 Windows 版本的 Python
wine python -m pip install --upgrade pip
wine python -m pip install pyinstaller keyboard pywin32
# 环境已预装,直接验证
- name: Verify tools
run: |
node --version
wine python --version
wine --version # 确认 wine 是否存在full 镜像很可能包含
- name: Build EXE using Wine Python
run: |
wine python -m PyInstaller --onefile --windowed --name Shortcut_Sync_PotPlayer main.py
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: PotPlayer-Sync-Tool
path: dist/Shortcut_Sync_PotPlayer.exe
retention-days: 7 # 临时文件保存7天
name: Shortcut_Sync_PotPlayer
path: dist/Shortcut_Sync_PotPlayer.exe