mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 10:26:46 +00:00
break distro out into separate files
This commit is contained in:
parent
712f5a3f16
commit
e5c6ca31f3
4 changed files with 193 additions and 171 deletions
23
src/distro/adoptopenjdk.ts
Normal file
23
src/distro/adoptopenjdk.ts
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue