graalvm-community: float latest to its own newest GA release

GraalVM Community publishes its releases on GitHub, so the `latest`
alias now matches against that real release list using the SemVer
wildcard instead of asking the Adoptium API for the newest GA major.
This prevents `latest` from hard-failing when GraalVM lags behind a
freshly released Java major (e.g. Adoptium reports 26 before GraalVM
ships it). Oracle GraalVM has no listing endpoint, so it keeps deriving
the newest major from Adoptium and errors clearly if that major is not
yet published.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Bruno Borges
2026-07-09 15:44:30 -04:00
parent 7155e1ca90
commit 94eba1b8f5
4 changed files with 93 additions and 14 deletions

25
dist/setup/index.js vendored
View File

@@ -133108,14 +133108,25 @@ class GraalVMCommunityDistribution extends GraalVMDistribution {
if (!this.stable) {
throw new Error('GraalVM Community does not provide early access builds');
}
// The `latest` alias is normalized to the SemVer wildcard. Resolve the newest
// available GA major from the Adoptium API so it can be matched against the
// published GraalVM Community releases.
if (this.latest) {
range = (await getLatestMajorVersion(this.http)).toString();
}
const arch = this.getSupportedArchitecture();
const { platform, extension } = this.validateStableBuildRequest(range);
// GraalVM Community publishes its releases on GitHub, so the `latest` alias
// (normalized to the SemVer wildcard `x`) can float to the newest GA it
// actually ships. Unlike Oracle GraalVM (which has no listing endpoint and
// must derive the newest major from the Adoptium API), we match against the
// real release list here, so `latest` never fails when GraalVM lags behind a
// brand-new Java major.
let platform;
let extension;
if (this.latest) {
if (this.packageType !== 'jdk') {
throw new Error(`${this.distribution} provides only the \`jdk\` package type`);
}
platform = this.getPlatform();
extension = getDownloadArchiveExtension();
}
else {
({ platform, extension } = this.validateStableBuildRequest(range));
}
// GraalVM Community asset names embed the platform, architecture and
// archive type, e.g. `graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz`.
const assetSuffix = `_${platform}-${arch}_bin.${extension}`;