setup-java/src/setup-java.ts

24 lines
678 B
TypeScript
Raw Normal View History

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