|
| 1 | +$ErrorActionPreference = "Stop" |
| 2 | + |
| 3 | +function Run($cmd) { |
| 4 | + Write-Host ">>> $cmd" |
| 5 | + iex $cmd |
| 6 | +} |
| 7 | + |
| 8 | +# Always run from repo root |
| 9 | +Set-Location $PSScriptRoot |
| 10 | + |
| 11 | +# Helpful debug |
| 12 | +Run "python --version" |
| 13 | +Run "python -c `"import sys; print(sys.executable)`"" |
| 14 | + |
| 15 | +# Create venvs |
| 16 | +Run "python -m venv trainer\env" |
| 17 | +Run "python -m venv painter\env" |
| 18 | + |
| 19 | +# Upgrade packaging tools in both |
| 20 | +Run "trainer\env\Scripts\python -m pip install --upgrade pip wheel setuptools" |
| 21 | +Run "painter\env\Scripts\python -m pip install --upgrade pip wheel setuptools" |
| 22 | + |
| 23 | +# Install deps (adjust if you use requirements-dev or constraints) |
| 24 | +Run "trainer\env\Scripts\pip install -r trainer\requirements.txt" |
| 25 | +Run "painter\env\Scripts\pip install -r painter\requirements.txt" |
| 26 | + |
| 27 | +# If your build relies on pyinstaller living in one env, pick ONE: |
| 28 | +# Option A: install pyinstaller in painter env |
| 29 | +Run "painter\env\Scripts\pip install pyinstaller" |
| 30 | + |
| 31 | +# Optional: print PyQt sanity (if applicable) |
| 32 | +Run "painter\env\Scripts\python -c `"import PyQt5; print('PyQt5 OK')`"" |
| 33 | + |
| 34 | +# Run your build entrypoint |
| 35 | +# If you have a Windows script already, call it here: |
| 36 | +# |
| 37 | +Run "painter\env\Scripts\python painter\src\build\build_workstation.py" |
| 38 | + |
| 39 | + |
| 40 | +# Zip output if present (nice for Actions downloads) |
| 41 | +$dist = "painter\src\build\dist" |
| 42 | +if (Test-Path $dist) { |
| 43 | + $zipPath = "RootPainter-Workstation-Windows.zip" |
| 44 | + if (Test-Path $zipPath) { Remove-Item $zipPath -Force } |
| 45 | + Run "powershell -Command `"Compress-Archive -Path '$dist\*' -DestinationPath '$zipPath'`"" |
| 46 | + Write-Host "Created $zipPath" |
| 47 | +} |
| 48 | + |
0 commit comments