23 lines
619 B
TypeScript
23 lines
619 B
TypeScript
import * as core from '@actions/core'
|
|
import * as util from './util'
|
|
import { download, getLatestVersion } from './download'
|
|
|
|
/**
|
|
* The main function for the action.
|
|
* @returns {Promise<void>} Resolves when the action is complete.
|
|
*/
|
|
export async function run(): Promise<void> {
|
|
try {
|
|
let conanVersion: string = core.getInput('conan-version')
|
|
|
|
if (conanVersion === '') {
|
|
conanVersion = await getLatestVersion()
|
|
}
|
|
|
|
const path = await download(conanVersion)
|
|
core.addPath(path + util.getConanBinPath())
|
|
} catch (error) {
|
|
if (error instanceof Error) core.setFailed(error.message)
|
|
}
|
|
}
|