🍎 Add macOS packaging + cross-platform build system

🔄 Unified build pipeline for Linux/macOS from Linux hosts
This commit is contained in:
Danny Morabito 2025-02-24 23:03:18 +01:00
parent f402ff04ab
commit 0c43dc5a76
Signed by: dannym
GPG key ID: 7CC8056A5A04557E
6 changed files with 951 additions and 18 deletions

View file

@ -7,10 +7,16 @@ import os from "node:os";
const relay = new RelayManager();
ipcMain.handle("relay:writeSeed", (_, ...args: any) => {
ipcMain.handle("relay:writeSeed", async (_, ...args: any) => {
if (!args[0]) throw new Error("No seed provided");
const seed = args[0] as string;
const configPath = path.join(os.homedir(), ".config", "arx", "Eve");
let configPath: string;
if (process.platform === "darwin") {
configPath = path.join(app.getPath("userData"), "arx", "Eve");
} else {
configPath = path.join(os.homedir(), ".config", "arx", "Eve");
}
const seedPath = path.join(configPath, "ccn.seed");
fs.mkdirSync(configPath, { recursive: true });
fs.writeFileSync(seedPath, seed);

View file

@ -2,7 +2,7 @@ import { spawn, ChildProcess } from "child_process";
import { join } from "path";
import { is } from "@electron-toolkit/utils";
type PackageEnvironment = "flatpak" | "appimage" | "system" | "dev";
type PackageEnvironment = "flatpak" | "appimage" | "system" | "mac" | "dev";
export class RelayManager {
private process: ChildProcess | null;
@ -50,6 +50,7 @@ export class RelayManager {
private detectEnvironment(): PackageEnvironment {
if (is.dev) return "dev";
if (process.platform === "darwin") return "mac";
if (process.env.FLATPAK_ID) return "flatpak";
if (process.env.APPIMAGE) return "appimage";
return "system";
@ -61,6 +62,8 @@ export class RelayManager {
switch (environment) {
case "dev":
return join(__dirname, "../../extras/linux/relay");
case "mac":
return join(process.resourcesPath, "macos", "eve-relay");
case "flatpak":
return "/app/lib/com.arx_ccn.eve/usr/bin/eve-relay";
case "appimage":