mirror of
https://github.com/threeal/cmake-action.git
synced 2025-12-18 06:15:13 +00:00
24 lines
573 B
TypeScript
24 lines
573 B
TypeScript
import { getErrorMessage } from "catched-error-message";
|
|
import fs from "node:fs";
|
|
import os from "node:os";
|
|
import { buildProject, configureProject } from "./cmake.js";
|
|
import { getContext } from "./context.js";
|
|
|
|
try {
|
|
const context = getContext();
|
|
|
|
configureProject(context);
|
|
|
|
fs.appendFileSync(
|
|
process.env["GITHUB_OUTPUT"] as string,
|
|
`build-dir=${context.buildDir}${os.EOL}`,
|
|
);
|
|
|
|
if (context.build.enabled) {
|
|
buildProject(context);
|
|
}
|
|
} catch (err) {
|
|
process.exitCode = 1;
|
|
process.stdout.write(`::error::${getErrorMessage(err)}${os.EOL}`);
|
|
}
|