2019-07-10 10:54:25 -04:00
|
|
|
import * as core from '@actions/core';
|
2019-07-10 23:11:48 -04:00
|
|
|
import * as installer from './installer';
|
2019-07-11 22:57:54 -04:00
|
|
|
import * as path from 'path';
|
2019-07-10 10:54:25 -04:00
|
|
|
|
|
|
|
async function run() {
|
2019-07-10 23:11:48 -04:00
|
|
|
try {
|
2019-08-13 16:24:39 -04:00
|
|
|
let version = core.getInput('version');
|
|
|
|
if (!version) {
|
|
|
|
version = core.getInput('java-version', {required: true});
|
|
|
|
}
|
2019-07-10 23:11:48 -04:00
|
|
|
const arch = core.getInput('architecture', {required: true});
|
2019-07-15 11:26:32 -04:00
|
|
|
const jdkFile = core.getInput('jdkFile', {required: false}) || '';
|
2019-07-10 23:11:48 -04:00
|
|
|
|
|
|
|
await installer.getJava(version, arch, jdkFile);
|
2019-07-11 22:57:54 -04:00
|
|
|
|
|
|
|
const matchersPath = path.join(__dirname, '..', '.github');
|
|
|
|
console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
|
2019-07-10 23:11:48 -04:00
|
|
|
} catch (error) {
|
|
|
|
core.setFailed(error.message);
|
|
|
|
}
|
2019-07-10 10:54:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
run();
|