feat(FN-5587): add windows desktop packaging workflow, scripts, and tests
Adds Windows desktop packaging support for Fusion, including a new GitHub Actions workflow for building Windows desktop targets, matching build scripts in the root and desktop package, a test for electron-builder configuration, and documentation of the packaging path. Fusion-Task-Id: FN-5587 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> Fusion-Task-Id: FN-5587
This commit is contained in:
@@ -340,6 +340,8 @@ Tray icons are generated from `packages/dashboard/app/public/logo.svg`.
|
||||
- `pnpm --filter @fusion/desktop generate:icons` — regenerate tray icon PNG assets from the dashboard logo SVG
|
||||
- `pnpm --filter @fusion/desktop pack` — generate unpacked artifacts via electron-builder (`--dir`)
|
||||
- `pnpm --filter @fusion/desktop dist` — generate installable desktop artifacts via electron-builder
|
||||
- `pnpm --filter @fusion/desktop dist:win` — generate Windows installable artifacts (`--win`)
|
||||
- `pnpm dist:desktop:win` — workspace alias to build desktop assets then run Windows packaging
|
||||
|
||||
## Packaging
|
||||
|
||||
@@ -347,6 +349,9 @@ Desktop packaging is configured in `electron-builder.yml`.
|
||||
|
||||
- Output directory: `packages/desktop/dist-electron`
|
||||
- Targets: macOS (`dmg`, `zip`), Windows (`nsis`, `portable`), Linux (`AppImage`, `deb`, `tar.gz`)
|
||||
- Windows artifacts: `Fusion-<version>-win-<arch>.exe` (NSIS installer) and portable `.exe` in `packages/desktop/dist-electron/`
|
||||
- Canonical Windows build path: `.github/workflows/desktop-windows.yml` (`workflow_dispatch` on `windows-latest`)
|
||||
- Windows `.exe` packaging requires a Windows host/runner for this task (no Wine-based cross-compilation path)
|
||||
- Deep link protocol: `fusion://`
|
||||
- Publish provider: GitHub (`gsxdsm/fusion`)
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
"typecheck": "tsc --noEmit",
|
||||
"generate:icons": "tsx scripts/generate-icons.ts",
|
||||
"pack": "electron-builder --dir",
|
||||
"dist": "electron-builder"
|
||||
"dist": "electron-builder",
|
||||
"dist:win": "electron-builder --win"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fusion/core": "workspace:*",
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const desktopRoot = path.resolve(__dirname, "../..");
|
||||
|
||||
async function readDesktopFile(relativePath: string): Promise<string> {
|
||||
return readFile(path.join(desktopRoot, relativePath), "utf-8");
|
||||
}
|
||||
|
||||
describe("electron-builder windows config", () => {
|
||||
it("keeps required Windows packaging targets and metadata", async () => {
|
||||
const builderConfig = await readDesktopFile("electron-builder.yml");
|
||||
|
||||
expect(builderConfig).toContain("win:");
|
||||
expect(builderConfig).toMatch(/win:\s*[\s\S]*?target:\s*[\s\S]*?-\s*target:\s*nsis/m);
|
||||
expect(builderConfig).toMatch(/win:\s*[\s\S]*?target:\s*[\s\S]*?-\s*target:\s*portable/m);
|
||||
|
||||
expect(builderConfig).toMatch(/nsis:\s*[\s\S]*?oneClick:\s*false/m);
|
||||
expect(builderConfig).toMatch(/nsis:\s*[\s\S]*?allowToChangeInstallationDirectory:\s*true/m);
|
||||
|
||||
expect(builderConfig).toMatch(/artifactName:\s*"\$\{productName\}-\$\{version\}-\$\{os\}-\$\{arch\}\.\$\{ext\}"/m);
|
||||
expect(builderConfig).toMatch(/appId:\s*com\.gsxdsm\.fusion\.desktop/m);
|
||||
expect(builderConfig).toMatch(/productName:\s*Fusion/m);
|
||||
});
|
||||
|
||||
it("exposes a dedicated dist:win script", async () => {
|
||||
const packageJsonRaw = await readDesktopFile("package.json");
|
||||
const packageJson = JSON.parse(packageJsonRaw) as { scripts?: Record<string, string> };
|
||||
|
||||
expect(packageJson.scripts?.["dist:win"]).toBe("electron-builder --win");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user