Files
setup-graalvm/src/features/check-for-updates.ts

32 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-11-03 17:21:00 +01:00
import * as core from '@actions/core'
2023-09-19 16:17:51 +02:00
export function checkForUpdates(
2022-11-03 17:21:00 +01:00
graalVMVersion: string,
javaVersion: string
2023-09-19 16:17:51 +02:00
): void {
2023-09-19 14:40:18 +02:00
if (javaVersion === '20') {
core.notice(
2023-09-19 16:17:51 +02:00
'A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee01177dd12d'
2023-09-19 14:40:18 +02:00
)
return
}
if (
graalVMVersion.length > 0 &&
(javaVersion === '17' || javaVersion === '19')
) {
2023-09-19 14:40:18 +02:00
const recommendedJDK = javaVersion === '17' ? '17' : '21'
core.notice(
2023-06-16 10:31:54 +02:00
`A new GraalVM release is available! Please consider upgrading to GraalVM for JDK ${recommendedJDK}. Instructions: https://github.com/graalvm/setup-graalvm#migrating-from-graalvm-223-or-earlier-to-the-new-graalvm-for-jdk-17-and-later`
)
return
}
2023-02-13 10:30:11 +01:00
if (graalVMVersion.startsWith('22.3.') && javaVersion === '11') {
2022-11-03 17:21:00 +01:00
core.notice(
2023-02-13 10:30:11 +01:00
'Please consider upgrading your project to Java 17+. GraalVM 22.3.X releases are the last to support JDK11: https://github.com/oracle/graal/issues/5063'
2022-11-03 17:21:00 +01:00
)
return
}
// TODO: add support for JDK-specific update checks (e.g., 17.0.X)
2022-11-03 17:21:00 +01:00
}