2022-01-03 08:52:11 +01:00
|
|
|
import * as otypes from '@octokit/types'
|
|
|
|
|
2022-08-31 10:07:18 +02:00
|
|
|
export const INPUT_VERSION = 'version'
|
|
|
|
export const INPUT_GDS_TOKEN = 'gds-token'
|
|
|
|
export const INPUT_JAVA_VERSION = 'java-version'
|
|
|
|
export const INPUT_COMPONENTS = 'components'
|
|
|
|
export const INPUT_GITHUB_TOKEN = 'github-token'
|
|
|
|
export const INPUT_SET_JAVA_HOME = 'set-java-home'
|
|
|
|
export const INPUT_CACHE = 'cache'
|
2022-11-02 14:00:51 +01:00
|
|
|
export const INPUT_CHECK_FOR_UPDATES = 'check-for-updates'
|
2022-08-31 10:07:18 +02:00
|
|
|
export const INPUT_NI_MUSL = 'native-image-musl'
|
|
|
|
|
2022-01-20 17:49:45 +01:00
|
|
|
export const IS_LINUX = process.platform === 'linux'
|
2022-01-03 08:52:11 +01:00
|
|
|
export const IS_MACOS = process.platform === 'darwin'
|
|
|
|
export const IS_WINDOWS = process.platform === 'win32'
|
|
|
|
|
2022-01-03 13:11:04 +01:00
|
|
|
export const VERSION_DEV = 'dev'
|
2022-01-03 08:52:11 +01:00
|
|
|
export const VERSION_LATEST = 'latest'
|
|
|
|
|
2022-03-08 10:47:41 +01:00
|
|
|
export const GRAALVM_ARCH = determineGraalVMArchitecture()
|
2022-01-03 08:52:11 +01:00
|
|
|
export const GRAALVM_FILE_EXTENSION = IS_WINDOWS ? '.zip' : '.tar.gz'
|
|
|
|
export const GRAALVM_GH_USER = 'graalvm'
|
|
|
|
export const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform
|
|
|
|
export const JDK_HOME_SUFFIX = IS_MACOS ? '/Contents/Home' : ''
|
|
|
|
|
2022-01-03 09:00:36 +01:00
|
|
|
export const MANDREL_NAMESPACE = 'mandrel-'
|
|
|
|
|
2022-03-03 17:24:24 +01:00
|
|
|
export const GDS_BASE = 'https://gds.oracle.com/api/20220101'
|
|
|
|
export const GDS_GRAALVM_PRODUCT_ID = 'D53FAE8052773FFAE0530F15000AA6C6'
|
|
|
|
|
2022-01-03 08:52:11 +01:00
|
|
|
export type LatestReleaseResponse =
|
|
|
|
otypes.Endpoints['GET /repos/{owner}/{repo}/releases/latest']['response']
|
2022-03-08 10:47:41 +01:00
|
|
|
|
|
|
|
function determineGraalVMArchitecture(): string {
|
|
|
|
switch (process.arch) {
|
|
|
|
case 'x64': {
|
|
|
|
return 'amd64'
|
|
|
|
}
|
|
|
|
case 'arm64': {
|
|
|
|
return 'aarch64'
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
throw new Error(`Unsupported architecture: ${process.arch}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|