From 93b68608e4605f62ad2434ef08958ecdb2208552 Mon Sep 17 00:00:00 2001 From: miu <205594122@qq.com> Date: Sun, 15 Mar 2026 03:44:16 +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 | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-exe.yml b/.github/workflows/build-exe.yml index ec4aeea..e63644e 100644 --- a/.github/workflows/build-exe.yml +++ b/.github/workflows/build-exe.yml @@ -2,37 +2,35 @@ name: Build Windows EXE on: push: - branches: [ "main" ] - workflow_dispatch: # 允许手动触发 + branches: ["main"] + workflow_dispatch: jobs: build: runs-on: windows-latest steps: - - name: Checkout code + - name: Checkout uses: actions/checkout@v4 - - name: Set up Python + - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.9.1' # 建议指定版本,确保稳定性 - cache: 'pip' # 自动缓存依赖,加快下次构建速度 + python-version: "3.9" - name: Install dependencies + shell: powershell run: | 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: | - # --clean 确保清理旧缓存 - # --admin-access 如果你的程序需要监听全局钩子,有时需要此权限 - python -m PyInstaller --noconfirm --onefile --windowed --name "Shortcut_Sync_PotPlayer" main.py + pyinstaller --onefile --windowed --name Shortcut_Sync_PotPlayer main.py - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: PotPlayer-Sync-Tool + name: Shortcut_Sync_PotPlayer path: dist/Shortcut_Sync_PotPlayer.exe - retention-days: 7 # 临时文件保存7天 \ No newline at end of file