Files
github-action-setup-xmake/src/index.ts
T
2020-06-30 01:54:04 +08:00

21 lines
646 B
TypeScript

import * as core from '@actions/core';
import { exec } from '@actions/exec';
import * as os from 'os';
import { selectVersion } from './versions';
import { winInstall } from './win-install';
import { unixInstall } from './unix-install';
async function run(): Promise<void> {
try {
const version = await selectVersion();
if (os.platform() === 'win32' || os.platform() === 'cygwin') await winInstall(version);
else await unixInstall(version);
await exec('xmake --version');
} catch (error) {
const ex = error as Error;
core.setFailed(ex.message);
}
}
run().catch((e) => core.error(e));