Support new GraalVM for JDK17/JDK20 release
This commit adds support for the new GraalVM for JDK17/JDK20 release, including the new Oracle GraalVM distribution. For this, users only need to specify the 'java-version' option and the new 'distribution' option. The 'version' option is now marked as optional and kept for compatibility with older GraalVM releases and Mandrel.
This commit is contained in:
committed by
Fabio Niephaus
parent
2f50b91043
commit
c871f91ee0
@@ -3,6 +3,7 @@ import * as otypes from '@octokit/types'
|
||||
export const INPUT_VERSION = 'version'
|
||||
export const INPUT_GDS_TOKEN = 'gds-token'
|
||||
export const INPUT_JAVA_VERSION = 'java-version'
|
||||
export const INPUT_DISTRIBUTION = 'distribution'
|
||||
export const INPUT_COMPONENTS = 'components'
|
||||
export const INPUT_GITHUB_TOKEN = 'github-token'
|
||||
export const INPUT_SET_JAVA_HOME = 'set-java-home'
|
||||
@@ -14,15 +15,22 @@ export const IS_LINUX = process.platform === 'linux'
|
||||
export const IS_MACOS = process.platform === 'darwin'
|
||||
export const IS_WINDOWS = process.platform === 'win32'
|
||||
|
||||
export const DISTRIBUTION_GRAALVM = 'graalvm'
|
||||
export const DISTRIBUTION_GRAALVM_COMMUNITY = 'graalvm-community'
|
||||
export const DISTRIBUTION_MANDREL = 'mandrel'
|
||||
|
||||
export const VERSION_DEV = 'dev'
|
||||
export const VERSION_LATEST = 'latest'
|
||||
|
||||
export const JDK_ARCH = determineJDKArchitecture()
|
||||
export const JDK_PLATFORM = determineJDKPlatform()
|
||||
export const JDK_HOME_SUFFIX = IS_MACOS ? '/Contents/Home' : ''
|
||||
|
||||
export const GRAALVM_ARCH = determineGraalVMArchitecture()
|
||||
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 GRAALVM_RELEASES_REPO = 'graalvm-ce-builds'
|
||||
export const JDK_HOME_SUFFIX = IS_MACOS ? '/Contents/Home' : ''
|
||||
|
||||
export const MANDREL_NAMESPACE = 'mandrel-'
|
||||
|
||||
@@ -32,9 +40,46 @@ export const GDS_GRAALVM_PRODUCT_ID = 'D53FAE8052773FFAE0530F15000AA6C6'
|
||||
export const ENV_GITHUB_EVENT_NAME = 'GITHUB_EVENT_NAME'
|
||||
export const EVENT_NAME_PULL_REQUEST = 'pull_request'
|
||||
|
||||
export const ERROR_HINT =
|
||||
'If you think this is a mistake, please file an issue at: https://github.com/graalvm/setup-graalvm/issues.'
|
||||
|
||||
export type LatestReleaseResponse =
|
||||
otypes.Endpoints['GET /repos/{owner}/{repo}/releases/latest']['response']
|
||||
|
||||
export type MatchingRefsResponse =
|
||||
otypes.Endpoints['GET /repos/{owner}/{repo}/git/matching-refs/{ref}']['response']
|
||||
|
||||
function determineJDKArchitecture(): string {
|
||||
switch (process.arch) {
|
||||
case 'x64': {
|
||||
return 'x64'
|
||||
}
|
||||
case 'arm64': {
|
||||
return 'aarch64'
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported architecture: ${process.arch}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function determineJDKPlatform(): string {
|
||||
switch (process.platform) {
|
||||
case 'linux': {
|
||||
return 'linux'
|
||||
}
|
||||
case 'darwin': {
|
||||
return 'macos'
|
||||
}
|
||||
case 'win32': {
|
||||
return 'windows'
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform: ${process.platform}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function determineGraalVMArchitecture(): string {
|
||||
switch (process.arch) {
|
||||
case 'x64': {
|
||||
|
||||
Reference in New Issue
Block a user