farmcontrol-server/scripts/build-macos.mjs
Tom Butcher d867d017bb
Some checks reported errors
farmcontrol/farmcontrol-server/pipeline/head Something is wrong with the build of this commit
Enhance Electrobun configuration and build scripts
- Updated electrobun.config.ts to dynamically set the application version from package.json and added a release configuration for base URL.
- Modified Jenkinsfile to include the ELECTROBUN_RELEASE_BASE_URL environment variable during the build process.
- Refactored build-macos.mjs to streamline the build command execution for different architectures.
- Enhanced finalize-desktop-artifacts.mjs to improve artifact handling and introduced a new pre-build script for validation of required files and environment variables.
- Improved error handling and logging for better build process visibility.
2026-08-01 20:12:30 +01:00

33 lines
759 B
JavaScript

import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import path from "node:path";
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const targetArchs = ["arm64", "x64"];
function run(command, args, options = {}) {
const result = spawnSync(command, args, {
cwd: rootDir,
stdio: "inherit",
env: process.env,
...options,
});
if (result.status !== 0) {
process.exit(result.status ?? 1);
}
}
run("bun", ["run", "build"]);
for (const targetArch of targetArchs) {
console.log(`\n=== Building macOS ${targetArch} ===\n`);
run("bun", ["electrobun", "build", "--env=stable"], {
env: {
...process.env,
ELECTROBUN_ARCH: targetArch,
},
});
}