mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-04-28 09:16:46 +08:00
Split features.ts
up.
This commit is contained in:
parent
f1c2f56b3e
commit
5704aa1938
30
src/features/check-for-updates.ts
Normal file
30
src/features/check-for-updates.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import * as core from '@actions/core'
|
||||||
|
import {toSemVer} from '../utils'
|
||||||
|
import {lt, major, minor, valid} from 'semver'
|
||||||
|
import {getLatestReleaseVersion} from '../graalvm'
|
||||||
|
|
||||||
|
export async function checkForUpdates(
|
||||||
|
graalVMVersion: string,
|
||||||
|
javaVersion: string
|
||||||
|
): Promise<void> {
|
||||||
|
if (graalVMVersion === '22.3.0' && javaVersion === '11') {
|
||||||
|
core.notice(
|
||||||
|
'Please consider upgrading your project to Java 17+. The GraalVM 22.3.0 release is the last to support JDK11: https://github.com/oracle/graal/issues/5063'
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const latestGraalVMVersion = await getLatestReleaseVersion()
|
||||||
|
const selectedVersion = toSemVer(graalVMVersion)
|
||||||
|
const latestVersion = toSemVer(latestGraalVMVersion)
|
||||||
|
if (
|
||||||
|
valid(selectedVersion) &&
|
||||||
|
valid(latestVersion) &&
|
||||||
|
lt(selectedVersion, latestVersion)
|
||||||
|
) {
|
||||||
|
core.notice(
|
||||||
|
`A new GraalVM release is available! Please consider upgrading to GraalVM ${latestGraalVMVersion}. Release notes: https://www.graalvm.org/release-notes/${major(
|
||||||
|
latestVersion
|
||||||
|
)}_${minor(latestVersion)}/`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -1,40 +1,12 @@
|
|||||||
import * as c from './constants'
|
import * as c from '../constants'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as tc from '@actions/tool-cache'
|
import * as tc from '@actions/tool-cache'
|
||||||
import {exec, toSemVer} from './utils'
|
import {exec} from '../utils'
|
||||||
import {join} from 'path'
|
import {join} from 'path'
|
||||||
import {lt, major, minor, valid} from 'semver'
|
|
||||||
import {getLatestReleaseVersion} from './graalvm'
|
|
||||||
|
|
||||||
const MUSL_NAME = 'x86_64-linux-musl-native'
|
const MUSL_NAME = 'x86_64-linux-musl-native'
|
||||||
const MUSL_VERSION = '10.2.1'
|
const MUSL_VERSION = '10.2.1'
|
||||||
|
|
||||||
export async function checkForUpdates(
|
|
||||||
graalVMVersion: string,
|
|
||||||
javaVersion: string
|
|
||||||
): Promise<void> {
|
|
||||||
if (graalVMVersion === '22.3.0' && javaVersion === '11') {
|
|
||||||
core.notice(
|
|
||||||
'Please consider upgrading your project to Java 17+. The GraalVM 22.3.0 release is the last to support JDK11: https://github.com/oracle/graal/issues/5063'
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const latestGraalVMVersion = await getLatestReleaseVersion()
|
|
||||||
const selectedVersion = toSemVer(graalVMVersion)
|
|
||||||
const latestVersion = toSemVer(latestGraalVMVersion)
|
|
||||||
if (
|
|
||||||
valid(selectedVersion) &&
|
|
||||||
valid(latestVersion) &&
|
|
||||||
lt(selectedVersion, latestVersion)
|
|
||||||
) {
|
|
||||||
core.notice(
|
|
||||||
`A new GraalVM release is available! Please consider upgrading to GraalVM ${latestGraalVMVersion}. Release notes: https://www.graalvm.org/release-notes/${major(
|
|
||||||
latestVersion
|
|
||||||
)}_${minor(latestVersion)}/`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function setUpNativeImageMusl(): Promise<void> {
|
export async function setUpNativeImageMusl(): Promise<void> {
|
||||||
if (!c.IS_LINUX) {
|
if (!c.IS_LINUX) {
|
||||||
core.warning('musl is only supported on Linux')
|
core.warning('musl is only supported on Linux')
|
@ -7,7 +7,8 @@ import {restore} from './features/cache'
|
|||||||
import {setUpDependencies} from './dependencies'
|
import {setUpDependencies} from './dependencies'
|
||||||
import {setUpGUComponents} from './gu'
|
import {setUpGUComponents} from './gu'
|
||||||
import {setUpMandrel} from './mandrel'
|
import {setUpMandrel} from './mandrel'
|
||||||
import {checkForUpdates, setUpNativeImageMusl} from './features'
|
import {checkForUpdates} from './features/check-for-updates'
|
||||||
|
import {setUpNativeImageMusl} from './features/musl'
|
||||||
import {setUpWindowsEnvironment} from './msvc'
|
import {setUpWindowsEnvironment} from './msvc'
|
||||||
import {setUpNativeImageBuildReports} from './features/reports'
|
import {setUpNativeImageBuildReports} from './features/reports'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user