feat: Add GitHub Actions workflow to build Windows executable.

This commit is contained in:
2026-03-15 02:04:06 +08:00
Unverified
parent 2d944ef1d1
commit 205b73dd5e

View File

@@ -5,40 +5,38 @@ on:
push: push:
branches: branches:
- main - main
release:
types:
- published
jobs: jobs:
build: build:
runs-on: windows runs-on: windows
steps: steps:
- name: Checkout repository - name: Show workspace
uses: actions/checkout@v4 shell: powershell
run: |
Write-Host "Workspace: $pwd"
Get-ChildItem
- name: Set up Python - name: Check Python
uses: actions/setup-python@v5 shell: powershell
with: run: |
python-version: "3.11" python --version
pip --version
- name: Install dependencies - name: Install dependencies
shell: powershell
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install pyinstaller keyboard pywin32 pip install pyinstaller keyboard pywin32
- name: Build executable - name: Build executable
shell: powershell
run: | run: |
pyinstaller --noconfirm --onefile --windowed --name Shortcut_Sync_PotPlayer main.py pyinstaller --noconfirm --onefile --windowed --name Shortcut_Sync_PotPlayer main.py
- name: Upload EXE artifact - name: Collect build output
uses: actions/upload-artifact@v4 shell: powershell
with: run: |
name: Shortcut_Sync_PotPlayer-windows New-Item -ItemType Directory -Force output | Out-Null
path: dist/Shortcut_Sync_PotPlayer.exe Copy-Item dist/Shortcut_Sync_PotPlayer.exe output/Shortcut_Sync_PotPlayer.exe -Force
Get-ChildItem output
- name: Upload release asset
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: dist/Shortcut_Sync_PotPlayer.exe