Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
- Updated `electrobun` dependency to version `1.18.4-beta.19` in `package.json` and `bun.lock`. - Added `rcedit` and `@tweenjs/tween.js` dependencies to `bun.lock`. - Modified `Jenkinsfile` to clean up additional staging directories for production builds. - Refactored `electrobun.config.ts` to dynamically read the `package.json` path. - Introduced new scripts for managing Hutch installation and execution, improving the build process. - Enhanced artifact finalization logic to support multiple build environments and streamline platform directory resolution.
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
export function getReleaseVersion(packageJson) {
|
|
return packageJson.version;
|
|
}
|
|
|
|
export function getReleaseArch(platformArch = process.arch) {
|
|
if (platformArch === "arm64" || platformArch === "aarch64") {
|
|
return "arm64";
|
|
}
|
|
if (platformArch === "x64" || platformArch === "amd64") {
|
|
return "x64";
|
|
}
|
|
return platformArch;
|
|
}
|
|
|
|
export function isBundleCefEnabled(
|
|
value = process.env.ELECTROBUN_BUNDLE_CEF,
|
|
) {
|
|
return ["1", "true", "yes"].includes(String(value || "").toLowerCase());
|
|
}
|
|
|
|
export function getReleaseArtifactName(version, arch, ext, options = {}) {
|
|
const cef =
|
|
typeof options === "boolean"
|
|
? options
|
|
: Boolean(options.cef ?? isBundleCefEnabled());
|
|
const cefSuffix = cef ? "-cef" : "";
|
|
return `farmcontrol-${version}-${arch}${cefSuffix}.${ext}`;
|
|
}
|
|
|
|
export function getElectrobunOutputEnvName(
|
|
buildEnv = process.env.ELECTROBUN_BUILD_ENV || "stable",
|
|
) {
|
|
if (buildEnv === "stable") {
|
|
return "production";
|
|
}
|
|
|
|
return buildEnv;
|
|
}
|
|
|
|
export function getElectrobunPlatformDirCandidates(
|
|
os,
|
|
arch,
|
|
buildEnv = process.env.ELECTROBUN_BUILD_ENV || "stable",
|
|
) {
|
|
const outputEnv = getElectrobunOutputEnvName(buildEnv);
|
|
return [
|
|
`${outputEnv}-${os}-${arch}`,
|
|
`stable-${os}-${arch}`,
|
|
`${buildEnv}-${os}-${arch}`,
|
|
];
|
|
}
|