Files
Synapsis-Desktop/scripts/create-update-manifest.mjs
cyph3rasi 7c185c9b36 Hide secondary windows until the login UI is painted, open external links in the default browser, and add signed Githop auto-updates
Hop-State: A_06FPJAAEMY0VXGY9S90PE90
Hop-Proposal: R_06FPJA9RY0ZAWJ1K0K760W8
Hop-Task: T_06FPJ5688NFG8VWKSFCTZEG
Hop-Attempt: AT_06FPJ5688M08V2K0PEFVQX0
2026-07-15 21:22:22 -07:00

32 lines
1.2 KiB
JavaScript

import { readFile, writeFile } from "node:fs/promises";
import process from "node:process";
const repository = "https://githop.xyz/GnosysLabs/Synapsis-Desktop";
const bundleDirectory = new URL("../src-tauri/target/release/bundle/macos/", import.meta.url);
const config = JSON.parse(
await readFile(new URL("../src-tauri/tauri.conf.json", import.meta.url), "utf8"),
);
const version = config.version;
const tag = process.env.SYNAPSIS_RELEASE_TAG || `v${version}`;
const notes = process.env.SYNAPSIS_RELEASE_NOTES || `Synapsis ${version}`;
const archiveName = "Synapsis.app.tar.gz";
const signature = (
await readFile(new URL(`${archiveName}.sig`, bundleDirectory), "utf8")
).trim();
const architecture = process.arch === "arm64" ? "aarch64" : "x86_64";
const manifest = {
version,
notes,
pub_date: new Date().toISOString(),
platforms: {
[`darwin-${architecture}`]: {
signature,
url: `${repository}/releases/download/${encodeURIComponent(tag)}/${archiveName}`,
},
},
};
const destination = new URL("latest.json", bundleDirectory);
await writeFile(destination, `${JSON.stringify(manifest, null, 2)}\n`);
console.log(`Created updater manifest for Synapsis ${version}.`);