2026-07-29 17:53:33 -04:00
export const id = 968 ;
export const ids = [ 968 ] ;
export const modules = {
/***/ 6968 :
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
/* harmony export */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
/* harmony export */ GraalVMCommunityDistribution : ( ) => ( /* binding */ GraalVMCommunityDistribution ) ,
/* harmony export */ GraalVMDistribution : ( ) => ( /* binding */ GraalVMDistribution )
/* harmony export */ } ) ;
/* harmony import */ var _actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 3838 ) ;
2026-08-04 23:05:06 -04:00
/* harmony import */ var fs _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 9896 ) ;
/* harmony import */ var fs _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( fs _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var path _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 6928 ) ;
/* harmony import */ var path _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( path _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
/* harmony import */ var semver _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( 2088 ) ;
/* harmony import */ var semver _ _WEBPACK _IMPORTED _MODULE _3 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( semver _ _WEBPACK _IMPORTED _MODULE _3 _ _ ) ;
/* harmony import */ var _base _installer _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( 6242 ) ;
/* harmony import */ var _actions _http _client _ _WEBPACK _IMPORTED _MODULE _5 _ _ = _ _webpack _require _ _ ( 4942 ) ;
/* harmony import */ var _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ = _ _webpack _require _ _ ( 4527 ) ;
2026-07-29 17:53:33 -04:00
const GRAALVM _DL _BASE = 'https://download.oracle.com/graalvm' ;
const GRAALVM _DOWNLOAD _URL = 'https://www.graalvm.org/downloads/' ;
const GRAALVM _COMMUNITY _RELEASES _URL = 'https://api.github.com/repos/graalvm/graalvm-ce-builds/releases?per_page=100' ;
const GRAALVM _COMMUNITY _RELEASES _PAGE _ORIGIN = 'https://api.github.com' ;
const GRAALVM _COMMUNITY _DOWNLOAD _URL = 'https://github.com/graalvm/graalvm-ce-builds/releases' ;
const GRAALVM _COMMUNITY _ASSET _PREFIX = 'graalvm-community-jdk-' ;
const GRAALVM _COMMUNITY _VERSION _PATTERN = /^\d+(?:\.\d+)*$/ ;
const IS _WINDOWS = process . platform === 'win32' ;
const GRAALVM _PLATFORM = IS _WINDOWS ? 'windows' : process . platform ;
const GRAALVM _MIN _VERSION = 17 ;
const SUPPORTED _ARCHITECTURES = [ 'x64' , 'aarch64' ] ;
2026-08-04 23:05:06 -04:00
class GraalVMDistribution extends _base _installer _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ /* .JavaBase */ . O {
2026-07-29 17:53:33 -04:00
constructor ( installerOptions , distributionName = 'GraalVM' ) {
super ( distributionName , installerOptions ) ;
}
async downloadTool ( javaRelease ) {
try {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .info */ . pq ( ` Downloading Java ${ javaRelease . version } ( ${ this . distribution } ) from ${ javaRelease . url } ... ` ) ;
let javaArchivePath = await this . downloadAndVerify ( javaRelease ) ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .info */ . pq ( ` Extracting Java archive... ` ) ;
2026-08-04 23:05:06 -04:00
const extension = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .getDownloadArchiveExtension */ . ag ) ( ) ;
2026-07-29 17:53:33 -04:00
if ( IS _WINDOWS ) {
2026-08-04 23:05:06 -04:00
javaArchivePath = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .renameWinArchive */ . n2 ) ( javaArchivePath ) ;
2026-07-29 17:53:33 -04:00
}
2026-08-04 23:05:06 -04:00
const extractedJavaPath = await ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .extractJdkFile */ . PE ) ( javaArchivePath , extension ) ;
2026-07-29 17:53:33 -04:00
// Add validation for extracted path
2026-08-04 23:05:06 -04:00
if ( ! fs _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default ( ) . existsSync ( extractedJavaPath ) ) {
2026-07-29 17:53:33 -04:00
throw new Error ( ` Extraction failed: path ${ extractedJavaPath } does not exist ` ) ;
}
2026-08-04 23:05:06 -04:00
const dirContents = fs _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default ( ) . readdirSync ( extractedJavaPath ) ;
2026-07-29 17:53:33 -04:00
if ( dirContents . length === 0 ) {
throw new Error ( 'Extraction failed: no files found in extracted directory' ) ;
}
2026-08-04 23:05:06 -04:00
const archivePath = path _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default ( ) . join ( extractedJavaPath , dirContents [ 0 ] ) ;
2026-07-29 17:53:33 -04:00
const version = this . getToolcacheVersionName ( javaRelease . version ) ;
2026-08-04 23:05:06 -04:00
const javaPath = await ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .cacheJdkDir */ . Vj ) ( archivePath , this . toolcacheFolderName , version , this . architecture ) ;
2026-07-29 17:53:33 -04:00
return { version : javaRelease . version , path : javaPath } ;
}
catch ( error ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .error */ . z3 ( ` Failed to download and extract GraalVM: ${ error } ` ) ;
throw error ;
}
}
setJavaDefault ( version , toolPath ) {
super . setJavaDefault ( version , toolPath ) ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .exportVariable */ . dN ( 'GRAALVM_HOME' , toolPath ) ;
}
async findPackageForDownload ( range ) {
this . validateVersionRange ( range ) ;
const arch = this . getSupportedArchitecture ( ) ;
if ( ! this . stable ) {
return this . findEABuildDownloadUrl ( ` ${ range } -ea ` ) ;
}
// The `latest` alias is normalized to the SemVer wildcard. Oracle GraalVM
// builds its download URLs from a concrete major and has no endpoint to list
// releases, so resolve the newest available GA major from the Adoptium API.
if ( this . latest ) {
2026-08-04 23:05:06 -04:00
range = ( await ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .getLatestMajorVersion */ . ri ) ( this . http ) ) . toString ( ) ;
2026-07-29 17:53:33 -04:00
}
const { platform , extension , major } = this . validateStableBuildRequest ( range ) ;
const fileUrl = this . constructFileUrl ( range , major , platform , arch , extension ) ;
const response = await this . http . head ( fileUrl ) ;
this . handleHttpResponse ( response , range ) ;
return {
url : fileUrl ,
version : range ,
checksum : await this . fetchChecksum ( ` ${ fileUrl } .sha256 ` , 'sha256' )
} ;
}
validateVersionRange ( range ) {
if ( ! range || typeof range !== 'string' ) {
throw new Error ( 'Version range is required and must be a string' ) ;
}
}
getSupportedArchitecture ( ) {
const arch = this . distributionArchitecture ( ) ;
if ( ! SUPPORTED _ARCHITECTURES . includes ( arch ) ) {
throw new Error ( ` Unsupported architecture: ${ this . architecture } . Supported architectures are: ${ SUPPORTED _ARCHITECTURES . join ( ', ' ) } ` ) ;
}
return arch ;
}
validateStableBuildRequest ( range ) {
if ( this . packageType !== 'jdk' ) {
throw new Error ( ` ${ this . distribution } provides only the \` jdk \` package type ` ) ;
}
const platform = this . getPlatform ( ) ;
2026-08-04 23:05:06 -04:00
const extension = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .getDownloadArchiveExtension */ . ag ) ( ) ;
2026-07-29 17:53:33 -04:00
const major = range . includes ( '.' ) ? range . split ( '.' ) [ 0 ] : range ;
const majorVersion = parseInt ( major ) ;
if ( isNaN ( majorVersion ) ) {
throw new Error ( ` Invalid version format: ${ range } ` ) ;
}
if ( majorVersion < GRAALVM _MIN _VERSION ) {
throw new Error ( ` ${ this . distribution } is only supported for JDK ${ GRAALVM _MIN _VERSION } and later. Requested version: ${ major } ` ) ;
}
return {
platform ,
major ,
extension
} ;
}
constructFileUrl ( range , major , platform , arch , extension ) {
return range . includes ( '.' )
? ` ${ GRAALVM _DL _BASE } / ${ major } /archive/graalvm-jdk- ${ range } _ ${ platform } - ${ arch } _bin. ${ extension } `
: ` ${ GRAALVM _DL _BASE } / ${ range } /latest/graalvm-jdk- ${ range } _ ${ platform } - ${ arch } _bin. ${ extension } ` ;
}
handleHttpResponse ( response , range ) {
const statusCode = response . message . statusCode ;
2026-08-04 23:05:06 -04:00
if ( statusCode === _actions _http _client _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .HttpCodes */ . Hv . NotFound ) {
2026-07-29 17:53:33 -04:00
// Create the standard error with additional hint about checking the download URL
const error = this . createVersionNotFoundError ( range ) ;
if ( this . latest ) {
error . message += ` \n The latest Java major version ( ${ range } ) is not yet available for the ${ this . distribution } distribution. Please specify a concrete version instead of 'latest'. ` ;
}
error . message += ` \n Please check if this version is available at ${ GRAALVM _DOWNLOAD _URL } . Pick a version from the list. ` ;
throw error ;
}
2026-08-04 23:05:06 -04:00
if ( statusCode === _actions _http _client _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .HttpCodes */ . Hv . Unauthorized ||
statusCode === _actions _http _client _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .HttpCodes */ . Hv . Forbidden ) {
2026-07-29 17:53:33 -04:00
throw new Error ( ` Access denied when downloading GraalVM. Status code: ${ statusCode } . Please check your credentials or permissions. ` ) ;
}
2026-08-04 23:05:06 -04:00
if ( statusCode !== _actions _http _client _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .HttpCodes */ . Hv . OK ) {
2026-07-29 17:53:33 -04:00
throw new Error ( ` HTTP request for GraalVM failed with status code: ${ statusCode } ( ${ response . message . statusMessage || 'Unknown error' } ) ` ) ;
}
}
async findEABuildDownloadUrl ( javaEaVersion ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Searching for EA build: ${ javaEaVersion } ` ) ;
const versions = await this . fetchEAJson ( javaEaVersion ) ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Found ${ versions . length } EA versions ` ) ;
const latestVersion = versions . find ( v => v . latest ) ;
if ( ! latestVersion ) {
const availableVersions = versions . map ( v => v . version ) ;
throw this . createVersionNotFoundError ( javaEaVersion , availableVersions , 'Note: No EA build is marked as latest for this version.' ) ;
}
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Latest version found: ${ latestVersion . version } ` ) ;
const arch = this . distributionArchitecture ( ) ;
const file = latestVersion . files . find ( f => f . arch === arch && f . platform === GRAALVM _PLATFORM ) ;
if ( ! file ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .error */ . z3 ( ` Available files for architecture ${ arch } : ${ JSON . stringify ( latestVersion . files ) } ` ) ;
throw new Error ( ` Unable to find file for architecture ' ${ arch } ' and platform ' ${ GRAALVM _PLATFORM } ' ` ) ;
}
if ( ! file . filename . startsWith ( 'graalvm-jdk-' ) ) {
throw new Error ( ` Invalid filename format: ${ file . filename } . Expected to start with 'graalvm-jdk-' ` ) ;
}
const downloadUrl = ` ${ latestVersion . download _base _url } ${ file . filename } ` ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Download URL: ${ downloadUrl } ` ) ;
return {
url : downloadUrl ,
version : latestVersion . version ,
checksum : await this . fetchChecksum ( ` ${ downloadUrl } .sha256 ` , 'sha256' )
} ;
}
async fetchEAJson ( javaEaVersion ) {
const url = ` https://api.github.com/repos/graalvm/oracle-graalvm-ea-builds/contents/versions/ ${ javaEaVersion } .json?ref=main ` ;
2026-08-04 23:05:06 -04:00
const headers = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .getGitHubHttpHeaders */ . U _ ) ( ) ;
2026-07-29 17:53:33 -04:00
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Trying to fetch available version info for GraalVM EA builds from ' ${ url } ' ` ) ;
try {
const response = await this . http . getJson ( url , headers ) ;
if ( ! response . result ) {
throw new Error ( ` No GraalVM EA build found for version ' ${ javaEaVersion } '. Please check if the version is correct. ` ) ;
}
return response . result ;
}
catch ( error ) {
if ( error instanceof Error ) {
// Check if it's a 404 error (file not found)
if ( error . message ? . includes ( '404' ) ) {
throw new Error ( ` GraalVM EA version ' ${ javaEaVersion } ' not found. Please verify the version exists in the EA builds repository. ` , { cause : error } ) ;
}
// Re-throw with more context
throw new Error ( ` Failed to fetch GraalVM EA version information for ' ${ javaEaVersion } ': ${ error . message } ` , { cause : error } ) ;
}
// If it's not an Error instance, throw a generic error
throw new Error ( ` Failed to fetch GraalVM EA version information for ' ${ javaEaVersion } ' ` , { cause : error } ) ;
}
}
getPlatform ( platform = process . platform ) {
const platformMap = {
darwin : 'macos' ,
win32 : 'windows' ,
linux : 'linux'
} ;
const result = platformMap [ platform ] ;
if ( ! result ) {
throw new Error ( ` Platform ' ${ platform } ' is not supported. Supported platforms: 'linux', 'macos', 'windows' ` ) ;
}
return result ;
}
}
class GraalVMCommunityDistribution extends GraalVMDistribution {
constructor ( installerOptions ) {
super ( installerOptions , 'GraalVM Community' ) ;
}
get toolcacheFolderName ( ) {
return ` Java_GraalVM_Community_ ${ this . packageType } ` ;
}
async findPackageForDownload ( range ) {
this . validateVersionRange ( range ) ;
if ( ! this . stable ) {
throw new Error ( 'GraalVM Community does not provide early access builds' ) ;
}
const arch = this . getSupportedArchitecture ( ) ;
// 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 ( ) ;
2026-08-04 23:05:06 -04:00
extension = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .getDownloadArchiveExtension */ . ag ) ( ) ;
2026-07-29 17:53:33 -04:00
}
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 } ` ;
const availableVersions = await this . getAvailableVersions ( assetSuffix ) ;
const satisfiedVersion = availableVersions
2026-08-04 23:05:06 -04:00
. filter ( item => ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .isVersionSatisfies */ . y ) ( range , item . version ) )
. sort ( ( a , b ) => - semver _ _WEBPACK _IMPORTED _MODULE _3 _ _ _default ( ) . compareBuild ( a . version , b . version ) ) [ 0 ] ;
2026-07-29 17:53:33 -04:00
if ( ! satisfiedVersion ) {
const error = this . createVersionNotFoundError ( range , availableVersions . map ( item => item . version ) , ` Platform: ${ platform } ` ) ;
error . message += ` \n Please check if this version is available at ${ GRAALVM _COMMUNITY _DOWNLOAD _URL } . ` ;
throw error ;
}
return satisfiedVersion ;
}
async getAvailableVersions ( assetSuffix ) {
2026-08-04 23:05:06 -04:00
const headers = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .getGitHubHttpHeaders */ . U _ ) ( ) ;
2026-07-29 17:53:33 -04:00
const versions = new Map ( ) ;
let releasesUrl = GRAALVM _COMMUNITY _RELEASES _URL ;
2026-08-04 23:05:06 -04:00
for ( let pageIndex = 0 ; releasesUrl && pageIndex < _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .MAX_PAGINATION_PAGES */ . Tp ; pageIndex ++ ) {
2026-07-29 17:53:33 -04:00
const response = await this . http . getJson ( releasesUrl , headers ) ;
// A successful GitHub releases listing is always a JSON array (possibly
// empty). Anything else indicates an unexpected/error payload (rate
// limiting, auth failure, etc.) that must be surfaced instead of being
// silently treated as "no releases", which would later look like a
// misleading "version not found" error.
if ( ! Array . isArray ( response . result ) ) {
throw new Error ( ` Unexpected response while listing GraalVM Community releases from ${ releasesUrl } ` +
` (HTTP status code: ${ response . statusCode } ). Expected a JSON array of releases. ` +
` Please check if the service is available at ${ GRAALVM _COMMUNITY _DOWNLOAD _URL } . ` ) ;
}
const releases = response . result ;
if ( releases . length === 0 ) {
break ;
}
for ( const release of releases ) {
if ( release . draft || release . prerelease ) {
continue ;
}
for ( const asset of release . assets ? ? [ ] ) {
const version = this . extractAssetVersion ( asset . name , assetSuffix ) ;
if ( version ) {
const digest = asset . digest ? . match ( /^sha256:([a-f0-9]{64})$/i ) ? . [ 1 ] ;
if ( ! digest ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` No authoritative sha256 digest is available for ${ asset . name } ; skipping checksum verification for this asset. ` ) ;
}
versions . set ( version , {
version ,
url : asset . browser _download _url ,
checksum : digest
? {
algorithm : 'sha256' ,
value : digest ,
source : GRAALVM _COMMUNITY _RELEASES _URL
}
: undefined
} ) ;
}
}
}
releasesUrl = this . getNextReleasesUrl ( response . headers ) ;
}
return [ ... versions . values ( ) ] ;
}
// Returns the GraalVM JDK version encoded in a release asset name when it
// matches the requested platform/architecture/archive suffix, otherwise null.
extractAssetVersion ( assetName , assetSuffix ) {
if ( ! assetName . startsWith ( GRAALVM _COMMUNITY _ASSET _PREFIX ) ||
! assetName . endsWith ( assetSuffix ) ) {
return null ;
}
const rawVersion = assetName . slice ( GRAALVM _COMMUNITY _ASSET _PREFIX . length , - assetSuffix . length ) ;
if ( ! GRAALVM _COMMUNITY _VERSION _PATTERN . test ( rawVersion ) ) {
return null ;
}
2026-08-04 23:05:06 -04:00
return ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .convertVersionToSemver */ . ZY ) ( rawVersion ) ;
2026-07-29 17:53:33 -04:00
}
getNextReleasesUrl ( headers ) {
2026-08-04 23:05:06 -04:00
const nextUrl = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .getNextPageUrlFromLinkHeader */ . rC ) ( headers ) ;
2026-07-29 17:53:33 -04:00
if ( nextUrl &&
2026-08-04 23:05:06 -04:00
! ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .validatePaginationUrl */ . SA ) ( nextUrl , GRAALVM _COMMUNITY _RELEASES _PAGE _ORIGIN ) ) {
2026-07-29 17:53:33 -04:00
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .warning */ . $e ( ` Ignoring pagination link with unexpected origin: ${ nextUrl } ` ) ;
return null ;
}
return nextUrl ;
}
}
/***/ } )
} ;