Leon4gr45/builder
0
1# OSW Studio Desktop2 3Electron shell around the OSW Studio Next.js standalone server (full Server4Mode: SQLite storage, deployments, server functions). This directory is the5single source of truth for the desktop app — CI releases and local builds both6use these exact files.7 8## Layout9 10- `electron/main.ts` — the entire main process: boots the bundled server,11 failure diagnostics, consent-based updates, menu12- `electron/icons/` — committed app icons (no build-time generation)13- `electron-builder.yml` — packaging config (dmg / nsis / AppImage / deb)14- `assemble-app.sh` — copies a finished Next.js standalone build into `app/`;15 shared verbatim by CI and local builds16- `tsup.config.ts` — compiles `main.ts` into `app/main.js`17- `package.json` — version is a `0.0.0` placeholder, set at build time from18 the repo root `package.json`19 20## Releasing21 22Releases are built and published by CI (`.github/workflows/desktop-release.yml`),23triggered by pushing a `desktop-v{version}` tag — normally via24`release-osw.sh` at the repo parent. The workflow builds all three platforms,25verifies the complete artifact set, generates release notes from26`.github/desktop-release-notes.md`, and publishes the GitHub release in a27single atomic step. If any platform build fails, nothing is published and28auto-updaters keep serving the previous complete release.29 30## Local build31 32From the repo parent directory:33 34```bash35./deploy-osw-desktop.sh [mac|win|linux|all]36```37 38Or manually from the repo root:39 40```bash41NEXT_PUBLIC_SERVER_MODE=true NEXT_PUBLIC_DESKTOP=true npm run build42./desktop/assemble-app.sh43cd desktop && npm ci && npm pkg set version=$(node -p "require('../package.json').version")44npx tsup && npx electron-builder --mac --publish never45```46 47## Dev mode48 49Run `npm run dev` in the repo root, then `npm run dev` in this directory —50the Electron window points at `localhost:3000` instead of booting the bundled51server.52 53## Updates54 55Updates are consent-based: the app checks GitHub releases on launch and via56Help → Check for Updates, but only downloads and installs when the user agrees57(`Download` → `Restart now`). Users can skip a version. On macOS, in-place58updates require code signing (not set up), so the app links to the releases59page instead.60 