Skip to content

Commit 627d1e0

Browse files
ci(release): validate the executable target against the supported list
Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 9c85409 commit 627d1e0

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎apps/server/vite.config.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,24 @@ const packExecutable = process.env.T3CODE_PACK_EXE === "1";
3939
// build host, so every archive of a release embeds the same runtime no matter
4040
// which Node happens to run the build.
4141
const SEA_NODE_VERSION = "26.8.2";
42+
const SEA_TARGETS = {
43+
"darwin-arm64": { platform: "darwin", arch: "arm64" },
44+
"darwin-x64": { platform: "darwin", arch: "x64" },
45+
"linux-arm64": { platform: "linux", arch: "arm64" },
46+
"linux-x64": { platform: "linux", arch: "x64" },
47+
"win-arm64": { platform: "win", arch: "arm64" },
48+
"win-x64": { platform: "win", arch: "x64" },
49+
} as const;
4250
const packExecutableTarget = process.env.T3CODE_PACK_EXE_TARGET?.trim();
51+
if (packExecutableTarget && !(packExecutableTarget in SEA_TARGETS)) {
52+
throw new Error(
53+
`T3CODE_PACK_EXE_TARGET must be one of ${Object.keys(SEA_TARGETS).join(", ")}, got "${packExecutableTarget}".`,
54+
);
55+
}
4356
const packExecutableTargets = packExecutableTarget
4457
? [
4558
{
46-
platform: packExecutableTarget.split("-")[0] as "darwin" | "linux" | "win",
47-
arch: packExecutableTarget.split("-")[1] as "arm64" | "x64",
59+
...SEA_TARGETS[packExecutableTarget as keyof typeof SEA_TARGETS],
4860
nodeVersion: SEA_NODE_VERSION,
4961
},
5062
]

0 commit comments

Comments
 (0)