Skip to content

Commit 1ee6e71

Browse files
committed
windows workstation build script
1 parent 19ceace commit 1ee6e71

2 files changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build Workstation (Windows)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
9+
jobs:
10+
build-windows:
11+
runs-on: windows-latest
12+
timeout-minutes: 90
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.11"
22+
23+
- name: Cache pip
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~\AppData\Local\pip\Cache
28+
key: ${{ runner.os }}-pip-${{ hashFiles('trainer/requirements.txt', 'painter/requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
32+
- name: Build Workstation (Windows)
33+
shell: pwsh
34+
run: |
35+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
36+
./build_workstation_win.ps1
37+
38+
- name: Upload artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: RootPainter-Workstation-Windows
42+
path: |
43+
painter\src\build\dist\**
44+
painter\src\build\out\**
45+
**\*.exe
46+
**\*.msi
47+
**\*.zip
48+
if-no-files-found: warn
49+

build_workstation_win.ps1

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

Comments
 (0)