mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2024-10-12 14:09:56 +08:00
parent
2fb264a6b0
commit
8dd4f51a5e
BIN
dist/cleanup/index.js
generated
vendored
BIN
dist/cleanup/index.js
generated
vendored
Binary file not shown.
BIN
dist/main/index.js
generated
vendored
BIN
dist/main/index.js
generated
vendored
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
import * as c from './constants'
|
||||
import * as core from '@actions/core'
|
||||
import * as semver from 'semver'
|
||||
import {GRAALVM_PLATFORM} from './constants'
|
||||
import {exec} from './utils'
|
||||
import {join} from 'path'
|
||||
import {gte as semverGte, valid as semverValid} from 'semver'
|
||||
|
||||
const BASE_FLAGS = ['--non-interactive', 'install', '--no-progress']
|
||||
const COMPONENT_TO_POST_INSTALL_HOOK = new Map<string, Map<string, string>>([
|
||||
@ -34,10 +34,11 @@ export async function setUpGUComponents(
|
||||
if (components.length == 0) {
|
||||
return // nothing to do
|
||||
}
|
||||
const coercedJavaVersion = semver.coerce(javaVersion)
|
||||
if (
|
||||
graalVMVersion === c.VERSION_DEV ||
|
||||
javaVersion === c.VERSION_DEV ||
|
||||
(semverValid(javaVersion) && semverGte(javaVersion, '21.0.0'))
|
||||
(coercedJavaVersion != null && semver.gte(coercedJavaVersion, '21.0.0'))
|
||||
) {
|
||||
if (components.length == 1 && components[0] === 'native-image') {
|
||||
core.warning(
|
||||
|
@ -83,11 +83,13 @@ async function run(): Promise<void> {
|
||||
throw new Error(`Unsupported distribution: ${distribution}`)
|
||||
}
|
||||
} else {
|
||||
const coercedJavaVersion = semver.coerce(javaVersion)
|
||||
switch (graalVMVersion) {
|
||||
case c.VERSION_LATEST:
|
||||
if (
|
||||
javaVersion.startsWith('17') ||
|
||||
(semver.valid(javaVersion) && semver.gte(javaVersion, '20.0.0'))
|
||||
(coercedJavaVersion !== null &&
|
||||
semver.gte(coercedJavaVersion, '20.0.0'))
|
||||
) {
|
||||
core.info(
|
||||
`This build is using the new Oracle GraalVM. To select a specific distribution, use the 'distribution' option (see https://github.com/graalvm/setup-graalvm/tree/main#options).`
|
||||
@ -106,7 +108,6 @@ async function run(): Promise<void> {
|
||||
'Downloading GraalVM EE dev builds is not supported'
|
||||
)
|
||||
}
|
||||
const coercedJavaVersion = semver.coerce(javaVersion)
|
||||
if (
|
||||
coercedJavaVersion !== null &&
|
||||
!semver.gte(coercedJavaVersion, '21.0.0')
|
||||
|
Loading…
Reference in New Issue
Block a user