feat: add NWNX C++ build pipeline
This commit is contained in:
@@ -120,3 +120,38 @@ export async function buildHaks(): Promise<{
|
||||
});
|
||||
return { success, output: result.output };
|
||||
}
|
||||
|
||||
export async function buildNWNX(
|
||||
target?: string,
|
||||
): Promise<{ success: boolean; output: string }> {
|
||||
const workspacePath = getWorkspacePath();
|
||||
|
||||
broadcast("build", "start", { type: "nwnx", target });
|
||||
|
||||
const cmd = target
|
||||
? [
|
||||
"bash",
|
||||
"-c",
|
||||
`cd /build/unified/build-nwnx && cmake --build . --target ${target} --parallel $(nproc)`,
|
||||
]
|
||||
: [
|
||||
"bash",
|
||||
"-c",
|
||||
"cd /build/unified && mkdir -p build-nwnx && cd build-nwnx && cmake .. && cmake --build . --parallel $(nproc)",
|
||||
];
|
||||
|
||||
const result = await runEphemeralContainer({
|
||||
image: "layonara-builder",
|
||||
cmd,
|
||||
binds: [`${workspacePath}/repos/unified:/build/unified`],
|
||||
workingDir: "/build/unified",
|
||||
});
|
||||
|
||||
const success = result.statusCode === 0;
|
||||
broadcast("build", success ? "complete" : "failed", {
|
||||
type: "nwnx",
|
||||
target,
|
||||
exitCode: result.statusCode,
|
||||
});
|
||||
return { success, output: result.output };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user