build(windows): fix PyInstaller packaging\n\n- Add spec file with hiddenimports and data dirs\n- Use spec in release workflow; fallback to --paths code\n- Insert ./code into sys.path when frozen to resolve local imports

This commit is contained in:
mwisnowski 2025-08-25 09:57:02 -07:00
parent e52dfd7bb5
commit 8fa040a05a
3 changed files with 46 additions and 2 deletions

View file

@ -29,7 +29,12 @@ jobs:
- name: Build executable (PyInstaller)
shell: powershell
run: |
pyinstaller --onefile --name mtg-deckbuilder code/main.py
# Build using spec for reliable packaging
pyinstaller mtg_deckbuilder.spec
if (!(Test-Path dist/mtg-deckbuilder.exe)) {
Write-Host 'Spec build failed; retrying simple build with --paths code'
pyinstaller --onefile --name mtg-deckbuilder --paths code code/main.py
}
if (!(Test-Path dist/mtg-deckbuilder.exe)) { throw 'Build failed: dist/mtg-deckbuilder.exe not found' }
- name: Upload artifact (Windows EXE)