mirror of
https://github.com/actions/setup-java.git
synced 2024-11-27 03:59:02 +00:00
7d219e5bd5
* Add java-package parameter to action, support jre, jdk, and jdk+fx (#1) * Update tests to use 'jdk', 'jre', and 'jdk+fx' javaPackage parameters * Match extension only at end of line * Update README.md * Update workflow to use 'node-version' instead of deprecated 'version'
25 lines
764 B
TypeScript
25 lines
764 B
TypeScript
import * as core from '@actions/core';
|
|
import * as installer from './installer';
|
|
import * as path from 'path';
|
|
|
|
async function run() {
|
|
try {
|
|
let version = core.getInput('version');
|
|
if (!version) {
|
|
version = core.getInput('java-version', {required: true});
|
|
}
|
|
const arch = core.getInput('architecture', {required: true});
|
|
const javaPackage = core.getInput('java-package', {required: true});
|
|
const jdkFile = core.getInput('jdkFile', {required: false}) || '';
|
|
|
|
await installer.getJava(version, arch, jdkFile, javaPackage);
|
|
|
|
const matchersPath = path.join(__dirname, '..', '.github');
|
|
console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
|
|
} catch (error) {
|
|
core.setFailed(error.message);
|
|
}
|
|
}
|
|
|
|
run();
|