add electron auto-update

This commit is contained in:
Ramnique Singh 2026-01-20 00:15:21 +05:30
parent ce3d5eb7f0
commit d92106741d
5 changed files with 1342 additions and 3 deletions

View file

@ -48,6 +48,21 @@ module.exports = {
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
// ZIP is used by Squirrel.Mac for auto-updates
config: (arch) => ({
// Path must match S3 publisher's folder structure: releases/darwin/{arch}
macUpdateManifestBaseUrl: `https://rowboat-desktop-app-releases.s3.amazonaws.com/releases/darwin/${arch}`
})
}
],
publishers: [
{
name: '@electron-forge/publisher-s3',
config: {
bucket: 'rowboat-desktop-app-releases',
region: 'us-east-1',
public: true,
folder: 'releases' // Creates structure: releases/darwin/arm64/files
}
}
],
hooks: {

View file

@ -14,6 +14,7 @@
"@x/core": "workspace:*",
"@x/shared": "workspace:*",
"chokidar": "^4.0.3",
"update-electron-app": "^3.0.0",
"zod": "^4.2.1"
},
"devDependencies": {
@ -24,6 +25,7 @@
"@electron-forge/maker-deb": "^7.11.1",
"@electron-forge/maker-dmg": "^7.11.1",
"@electron-forge/maker-squirrel": "^7.11.1",
"@electron-forge/maker-zip": "^7.11.1"
"@electron-forge/maker-zip": "^7.11.1",
"@electron-forge/publisher-s3": "^7.11.1"
}
}

View file

@ -4,6 +4,7 @@ import { setupIpcHandlers, startRunsWatcher, startWorkspaceWatcher, stopWorkspac
import { fileURLToPath, pathToFileURL } from "node:url";
import { dirname } from "node:path";
import { existsSync } from "node:fs";
import { updateElectronApp, UpdateSourceType } from "update-electron-app";
import { init as initGmailSync } from "@x/core/dist/knowledge/sync_gmail.js";
import { init as initCalendarSync } from "@x/core/dist/knowledge/sync_calendar.js";
import { init as initFirefliesSync } from "@x/core/dist/knowledge/sync_fireflies.js";
@ -114,6 +115,17 @@ app.whenReady().then(() => {
fetch('http://127.0.0.1:7242/ingest/dd33b297-24f6-4846-82f9-02599308a13a',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'main.ts:77',message:'protocol registered',data:{isPackaged:app.isPackaged},timestamp:Date.now(),sessionId:'debug-session',runId:'run1',hypothesisId:'C'})}).catch(()=>{});
// #endregion
// Initialize auto-updater (only in production)
if (app.isPackaged) {
updateElectronApp({
updateSource: {
type: UpdateSourceType.StaticStorage,
baseUrl: `https://rowboat-desktop-app-releases.s3.amazonaws.com/releases/${process.platform}/${process.arch}`
},
notifyUser: true // Shows native dialog when update is available
});
}
setupIpcHandlers();
createWindow();