forked from Hsdi/Shortcut_Sync_PotPlayer
更新 .github/workflows/build-exe.yml
This commit is contained in:
24
.github/workflows/build-exe.yml
vendored
24
.github/workflows/build-exe.yml
vendored
@@ -2,37 +2,35 @@ name: Build Windows EXE
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
workflow_dispatch: # 允许手动触发
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.9.1' # 建议指定版本,确保稳定性
|
python-version: "3.9"
|
||||||
cache: 'pip' # 自动缓存依赖,加快下次构建速度
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install pyinstaller keyboard pywin32
|
pip install pyinstaller keyboard pywin32
|
||||||
|
|
||||||
- name: Build with PyInstaller
|
- name: Build EXE
|
||||||
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
# --clean 确保清理旧缓存
|
pyinstaller --onefile --windowed --name Shortcut_Sync_PotPlayer main.py
|
||||||
# --admin-access 如果你的程序需要监听全局钩子,有时需要此权限
|
|
||||||
python -m PyInstaller --noconfirm --onefile --windowed --name "Shortcut_Sync_PotPlayer" main.py
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: PotPlayer-Sync-Tool
|
name: Shortcut_Sync_PotPlayer
|
||||||
path: dist/Shortcut_Sync_PotPlayer.exe
|
path: dist/Shortcut_Sync_PotPlayer.exe
|
||||||
retention-days: 7 # 临时文件保存7天
|
|
||||||
Reference in New Issue
Block a user