|
|
@@ -1,5 +1,7 @@
|
|
|
#!/usr/bin/env bun
|
|
|
import { $ } from "bun"
|
|
|
+import { existsSync } from "node:fs"
|
|
|
+import { join, resolve } from "node:path"
|
|
|
import { validateRuntimeBundle } from "./runtime-bundle"
|
|
|
|
|
|
// Build and package locally. Publishing is always a separate, explicit action.
|
|
|
@@ -25,8 +27,20 @@ if (!external) {
|
|
|
)
|
|
|
await validateRuntimeBundle("resources/agentpaas-runtime")
|
|
|
}
|
|
|
+if (process.platform === "win32") {
|
|
|
+ if (process.arch !== "x64") throw new Error("Build the Windows Beta installer using x64 Bun")
|
|
|
+ const runtime = process.env.LAMBDA_AGENT_WINDOWS_RUNTIME
|
|
|
+ if (!runtime) throw new Error("Set LAMBDA_AGENT_WINDOWS_RUNTIME to the prepared Windows runtime directory")
|
|
|
+ process.env.LAMBDA_AGENT_WINDOWS_RUNTIME = resolve(runtime)
|
|
|
+ for (const file of ["git/cmd/git.exe", "git/LICENSE.txt", "ripgrep/rg.exe", "ripgrep/COPYING"]) {
|
|
|
+ if (!existsSync(join(runtime, file))) throw new Error(`Missing Windows runtime file: ${file}`)
|
|
|
+ }
|
|
|
+}
|
|
|
await $`bun run build`
|
|
|
+const electronDist = process.platform === "win32" && process.env.LAMBDA_AGENT_ELECTRON_DIST
|
|
|
const options = [
|
|
|
+ ...(electronDist ? [`--config.electronDist=${resolve(electronDist)}`] : []),
|
|
|
+ ...(process.platform === "win32" ? ["--win", "nsis", "--x64"] : []),
|
|
|
...(process.argv.includes("--dir") ? ["--dir"] : []),
|
|
|
...(unsigned && process.platform === "darwin" ? ["-c.mac.notarize=false", "-c.dmg.sign=false"] : []),
|
|
|
]
|