Support Beta release channel (#591)

This commit is contained in:
Will Chen
2025-07-07 17:15:02 -07:00
committed by GitHub
parent ab6a9d3b34
commit a93536386b
21 changed files with 181 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ import { registerIpcHandlers } from "./ipc/ipc_host";
import dotenv from "dotenv";
// @ts-ignore
import started from "electron-squirrel-startup";
import { updateElectronApp } from "update-electron-app";
import { updateElectronApp, UpdateSourceType } from "update-electron-app";
import log from "electron-log";
import { readSettings, writeSettings } from "./main/settings";
import { handleSupabaseOAuthReturn } from "./supabase_admin/supabase_return_handler";
@@ -20,7 +20,19 @@ const logger = log.scope("main");
// Check settings before enabling auto-update
const settings = readSettings();
if (settings.enableAutoUpdate) {
updateElectronApp({ logger }); // additional configuration options available
// Technically we could just pass the releaseChannel directly to the host,
// but this is more explicit and falls back to stable if there's an unknown
// release channel.
const postfix = settings.releaseChannel === "beta" ? "beta" : "stable";
const host = `https://api.dyad.sh/v1/update/${postfix}`;
updateElectronApp({
logger,
updateSource: {
type: UpdateSourceType.ElectronPublicUpdateService,
repo: "dyad-sh/dyad",
host,
},
}); // additional configuration options available
}
// Load environment variables from .env file