break distro out into separate files

This commit is contained in:
George Adams 2020-05-26 15:30:46 +01:00
parent 712f5a3f16
commit e5c6ca31f3
No known key found for this signature in database
GPG key ID: 7B8D7E4421A0916D
4 changed files with 193 additions and 171 deletions

View file

@ -0,0 +1,23 @@
import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';
export async function getJavaAdoptOpenJDK(
version: string,
javaPackage: string,
arch: string,
OS: string
) {
core.debug('Downloading JDK from AdoptOpenJDK');
const jdkFile = await tc.downloadTool(
`https://api.adoptopenjdk.net/v3/binary/latest/${normalize(
version
)}/ga/${OS}/${arch}/${javaPackage}/hotspot/normal/adoptopenjdk`
);
return [jdkFile, version];
}
function normalize(version: string): string {
if (version == '1.8') return '8';
return version;
}