add desktop build support

This commit is contained in:
matei jordache
2026-03-23 17:03:36 -07:00
parent 87b6905fba
commit 080eefbef6
14 changed files with 528 additions and 52 deletions

48
scripts/build-desktop.ps1 Normal file
View File

@@ -0,0 +1,48 @@
param(
[switch]$OneFile
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$repoRoot = Split-Path -Parent $PSScriptRoot
Set-Location $repoRoot
$pythonExe = if (Test-Path ".\.venv\Scripts\python.exe") {
".\.venv\Scripts\python.exe"
} else {
"python"
}
$frontendDist = Join-Path $repoRoot "frontend\dist"
Write-Host "Building frontend bundle..."
npm run build
Write-Host "Installing desktop build dependencies..."
& $pythonExe -m pip install -e ".[desktop]"
$mode = if ($OneFile) { "--onefile" } else { "--onedir" }
$pyInstallerArgs = @(
"-m", "PyInstaller",
"desktop.py",
"--noconfirm",
"--clean",
"--name", "Argonode",
"--windowed",
$mode,
"--distpath", "desktop-dist",
"--workpath", "desktop-build",
"--specpath", "desktop-build",
"--add-data", "${frontendDist};frontend/dist",
"--collect-all", "matplotlib",
"--collect-all", "scipy",
"--collect-all", "skimage",
"--collect-all", "webview"
)
Write-Host "Packaging desktop app..."
& $pythonExe @pyInstallerArgs
Write-Host "Desktop build complete."
Write-Host "Output folder: $repoRoot\desktop-dist\Argonode"