2021-09-14 15:03:59 +08:00
|
|
|
import * as core from "@actions/core"
|
2021-09-14 15:33:49 +08:00
|
|
|
import { setupCmake } from "./cmake/cmake"
|
2021-09-14 15:03:59 +08:00
|
|
|
|
|
|
|
export async function main(): Promise<number> {
|
|
|
|
try {
|
2021-09-14 15:33:49 +08:00
|
|
|
// setup cmake
|
|
|
|
const cmakeVersion = core.getInput("cmake")
|
|
|
|
if (cmakeVersion !== "false" && cmakeVersion !== "") {
|
|
|
|
await setupCmake(cmakeVersion)
|
|
|
|
}
|
2021-09-14 15:03:59 +08:00
|
|
|
} catch (err) {
|
|
|
|
core.error(err as string | Error)
|
|
|
|
core.setFailed("install-cpp failed")
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
core.info("install-cpp succeeded")
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
main()
|
|
|
|
.then((ret) => {
|
|
|
|
process.exitCode = ret
|
|
|
|
})
|
|
|
|
.catch((error) => {
|
2021-09-14 15:33:49 +08:00
|
|
|
core.error("main() failed!")
|
|
|
|
core.error(error as string | Error)
|
2021-09-14 15:03:59 +08:00
|
|
|
process.exitCode = 1
|
|
|
|
})
|