2020-05-09 21:50:47 +07:00
|
|
|
import { setFailed, startGroup, endGroup } from '@actions/core'
|
2020-05-08 13:06:16 +07:00
|
|
|
import { Inputs } from '../inputs'
|
2020-05-08 11:29:39 +07:00
|
|
|
import runSelfInstaller from './run'
|
|
|
|
|
|
|
|
|
|
export { runSelfInstaller }
|
|
|
|
|
|
2026-05-07 12:58:58 +02:00
|
|
|
export async function install(inputs: Inputs): Promise<string | undefined> {
|
2020-05-09 21:50:47 +07:00
|
|
|
startGroup('Running self-installer...')
|
2026-05-07 12:58:58 +02:00
|
|
|
const { exitCode, binDest } = await runSelfInstaller(inputs)
|
2020-05-09 21:50:47 +07:00
|
|
|
endGroup()
|
2026-05-07 12:58:58 +02:00
|
|
|
if (exitCode) {
|
|
|
|
|
setFailed(`Something went wrong, self-installer exits with code ${exitCode}`)
|
|
|
|
|
return undefined
|
2020-05-08 11:29:39 +07:00
|
|
|
}
|
2026-05-07 12:58:58 +02:00
|
|
|
return binDest
|
2020-05-08 11:29:39 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default install
|