| name | electron |
| description | Build, package, and deploy the Electron desktop app. Handles version bumps, packaging with electron-builder, deploy to VPS auto-updater. Triggers on "electron build", "deploy electron", "electron update", "update desktop app", "package app". |
Electron Build & Deploy Skill
Full pipeline: check state → optional version bump → build → package → deploy to VPS auto-updater.
Environment Variables (hardcoded for this project)
These are ALWAYS set automatically — never ask the user:
VPS_HOST=84.46.253.137
SITE_URL=https://in-theflow.com
VPS_USER=root (default in script)
Key Files
| File | Purpose |
|---|
electron/main.ts | Main process — window creation, IPC registration, updater |
electron/preload.ts | Context bridge — exposes window.electronAPI to renderer |
electron/ipc/ | IPC handlers (shell, dialog, fs, store, http, window) |
electron/updater.ts | Auto-updater via electron-updater |
electron-builder.yml | Packaging config |
dist-electron/ | Compiled output (generated; has package.json with type:commonjs) |
Workflow
Step 1: Check Current State
Run in parallel:
grep '"version"' package.json | head -1
curl -s https://in-theflow.com/updates/electron/latest-linux.yml | head -5
git status --short
git log --oneline -10
Display to user:
## Electron Deploy Status
- Source version: X.Y.Z
- Deployed version: X.Y.Z
- Uncommitted changes: [list or "none"]
Step 2: Version Bump Decision
Compare source version vs deployed version.
If source version == deployed version (no bump yet):
- A version bump is MANDATORY before deploying
- Use AskUserQuestion:
- Question: "What type of version bump?" (header: "Version")
- Options:
- "Patch (X.Y.Z+1)" (description: "Bug fixes, small changes") — Recommended
- "Minor (X.Y+1.0)" (description: "New features, significant changes")
Then bump only package.json (no Cargo.toml, no tauri.conf.json):
npm version patch --no-git-tag-version
If source version > deployed version (already bumped):
- Skip bump, inform user: "Version already bumped to X.Y.Z (deployed: A.B.C)"
Step 3: Get Release Notes
Use AskUserQuestion:
- Question: "What are the release notes for this version?" (header: "Notes")
- Options:
- "Auto-generate from commits" (description: "Use git log since last deploy")
- "Custom notes" (description: "I'll write the notes")
If auto-generate: Run git log --oneline for recent commits since last deploy.
If custom: Ask in plain text: "Enter release notes (1-2 sentences):"
Step 4: Commit if Needed
If there are uncommitted changes (from step 1 or version bump):
git add package.json
git commit -m "chore: v{VERSION} — {brief summary}"
Step 5: Build & Package
ELECTRON_BUILD=true npm run build
npm run electron:build-main
npx electron-builder --config electron-builder.yml --linux
Important notes:
npmRebuild=false in electron-builder.yml — skip native module rebuild
dist-electron/package.json with {"type":"commonjs"} is generated by electron:build-main — needed because root package.json has "type":"module"
- Output:
release/linux-unpacked/flowstate + AppImage in release/
Run with timeout: 600000 (10 min max — packaging can take time).
Inform user: "Build pipeline started. This takes ~2-3 minutes (Vue build + Electron compile + package)."
Step 6: Deploy
VPS_HOST=84.46.253.137 SITE_URL=https://in-theflow.com ./scripts/deploy-electron-update.sh --notes "{release_notes}"
Run with run_in_background: true.
Step 7: Verify
When the background task completes, verify:
curl -s https://in-theflow.com/updates/electron/latest-linux.yml | head -5
If successful, display:
## Electron Deploy Complete
- Version: X.Y.Z
- Endpoint: https://in-theflow.com/updates/electron/latest-linux.yml
- Users will see the update on next app launch
If failed, read full output and diagnose:
- Build errors → Show relevant error and suggest fix
- SSH/upload errors → Check VPS connectivity (
ssh root@84.46.253.137)
- Missing artifacts → Check
release/ directory for AppImage
Step 8: Push Git
After successful deploy:
git push
Options (via args)
| Arg | Effect |
|---|
--skip-deploy | Build only, don't upload to VPS |
--dry-run | Preview what would happen |
--no-bump | Skip version bump (use current version) |
Examples:
electron build — Full pipeline (bump + build + deploy + push)
electron build --skip-deploy — Build locally only
electron build --dry-run — Preview
Local Install / Testing
./release/linux-unpacked/flowstate --no-sandbox
flowstate
Important Rules
- Only bump
package.json — No Cargo.toml, no tauri.conf.json (Electron has no Rust)
- No signing key needed — Unlike Tauri, Electron builds don't require a signing key for Linux
- AppImage is the self-updating format — .deb cannot self-update
npmRebuild: false must stay in electron-builder.yml — native module rebuild not needed
- Never manually create
latest-linux.yml — electron-builder generates it; deploy script uploads it
- Never skip the deploy script — It has safeguards (env validation, manifest verification)
- WM_CLASS = "flow-state" — Set by
app.setName() in main.ts + --class flag in wrapper script