2026-07-29 17:53:33 -04:00
export const id = 978 ;
export const ids = [ 978 ] ;
export const modules = {
/***/ 9597 :
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
/* harmony export */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
/* harmony export */ ZuluDistribution : ( ) => ( /* binding */ ZuluDistribution )
/* 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 path _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 6928 ) ;
/* harmony import */ var path _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( path _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var fs _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 9896 ) ;
/* harmony import */ var fs _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( fs _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
2026-10-02 00:07:25 -04:00
/* harmony import */ var _base _installer _js _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( 6242 ) ;
/* harmony import */ var _platform _types _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( 7444 ) ;
/* harmony import */ var _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ = _ _webpack _require _ _ ( 4527 ) ;
2026-08-05 12:54:41 -04:00
2026-07-29 17:53:33 -04:00
2026-10-02 00:07:25 -04:00
function compareNumberArrays ( a , b ) {
const length = Math . max ( a . length , b . length ) ;
for ( let i = 0 ; i < length ; i ++ ) {
const diff = ( a [ i ] ? ? 0 ) - ( b [ i ] ? ? 0 ) ;
if ( diff !== 0 ) {
return diff ;
}
}
return 0 ;
}
class ZuluDistribution extends _base _installer _js _ _WEBPACK _IMPORTED _MODULE _3 _ _ /* .JavaBase */ . O {
2026-07-29 17:53:33 -04:00
constructor ( installerOptions ) {
super ( 'Zulu' , installerOptions ) ;
}
async findPackageForDownload ( version ) {
const availableVersionsRaw = await this . getAvailableVersions ( ) ;
const availableVersions = availableVersionsRaw . map ( item => {
// The Azul Metadata API reports the JDK build number separately from
// java_version (e.g. java_version=[17,0,7], openjdk_build_number=7).
// Append it so the resulting semver retains the build (e.g. 17.0.7+7).
const javaVersion = item . openjdk _build _number != null
? [ ... item . java _version , item . openjdk _build _number ]
: item . java _version ;
return {
2026-10-02 00:07:25 -04:00
version : ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .convertVersionToSemver */ . ZY ) ( javaVersion ) ,
2026-07-29 17:53:33 -04:00
url : item . download _url ,
2026-10-02 00:07:25 -04:00
javaVersion : item . java _version ,
buildNumber : item . openjdk _build _number ? ? 0 ,
distroVersion : item . distro _version ,
2026-07-29 17:53:33 -04:00
packageUuid : item . package _uuid
} ;
} ) ;
const satisfiedVersions = availableVersions
2026-10-02 00:07:25 -04:00
. filter ( item => ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .isVersionSatisfies */ . y ) ( version , item . version ) )
2026-07-29 17:53:33 -04:00
. sort ( ( a , b ) => {
2026-10-02 00:07:25 -04:00
// Compare numerically rather than via semver build metadata: Azul
// hotfix releases carry a 4th java_version segment (e.g. 25.0.4.1+1,
// rendered as '25.0.4+1.1') that must rank above 25.0.4+7, whereas
// semver.compareBuild would order the build identifiers '7' > '1'.
return ( - compareNumberArrays ( a . javaVersion , b . javaVersion ) ||
b . buildNumber - a . buildNumber ||
- compareNumberArrays ( a . distroVersion , b . distroVersion ) ) ;
2026-07-29 17:53:33 -04:00
} )
. map ( ( item ) => ( {
version : item . version ,
url : item . url ,
packageUuid : item . packageUuid
} ) ) ;
const resolvedFullVersion = satisfiedVersions . length > 0 ? satisfiedVersions [ 0 ] : null ;
if ( ! resolvedFullVersion ) {
const availableVersionStrings = availableVersions . map ( item => item . version ) ;
throw this . createVersionNotFoundError ( version , availableVersionStrings ) ;
}
const packageDetailsUrl = ` https://api.azul.com/metadata/v1/zulu/packages/ ${ resolvedFullVersion . packageUuid } ` ;
const packageDetails = ( await this . http . getJson ( packageDetailsUrl ) ) . result ;
const digest = packageDetails ? . sha256 _hash ? . match ( /^[a-f0-9]{64}$/i ) ? . [ 0 ] ;
if ( ! digest ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` No authoritative sha256 checksum is available for Zulu version ${ resolvedFullVersion . version } from ${ packageDetailsUrl } ; skipping checksum verification. ` ) ;
}
return {
version : resolvedFullVersion . version ,
url : resolvedFullVersion . url ,
checksum : digest
? {
algorithm : 'sha256' ,
value : digest ,
source : packageDetailsUrl
}
: undefined
} ;
}
async downloadTool ( javaRelease ) {
_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-10-02 00:07:25 -04:00
const extension = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .getDownloadArchiveExtension */ . ag ) ( ) ;
2026-07-29 17:53:33 -04:00
if ( process . platform === 'win32' ) {
2026-10-02 00:07:25 -04:00
javaArchivePath = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .renameWinArchive */ . n2 ) ( javaArchivePath ) ;
2026-07-29 17:53:33 -04:00
}
2026-10-02 00:07:25 -04:00
const extractedJavaPath = await ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .extractJdkFile */ . PE ) ( javaArchivePath , extension ) ;
2026-08-04 23:05:06 -04:00
const archiveName = fs _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default ( ) . readdirSync ( extractedJavaPath ) [ 0 ] ;
const archivePath = path _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default ( ) . join ( extractedJavaPath , archiveName ) ;
2026-10-02 00:07:25 -04:00
const javaPath = await ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .cacheJdkDir */ . Vj ) ( archivePath , this . toolcacheFolderName , this . getToolcacheVersionName ( javaRelease . version ) , this . architecture ) ;
2026-07-29 17:53:33 -04:00
return { version : javaRelease . version , path : javaPath } ;
}
async getAvailableVersions ( ) {
const arch = this . getArchitectureOptions ( ) ;
const [ bundleType , features ] = this . packageType . split ( '+' ) ;
const platform = this . getPlatformOption ( ) ;
2026-10-02 00:07:25 -04:00
const extension = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .getDownloadArchiveExtension */ . ag ) ( ) ;
2026-07-29 17:53:33 -04:00
const javafx = features ? . includes ( 'fx' ) ? ? false ;
const crac = features ? . includes ( 'crac' ) ? ? false ;
const releaseStatus = this . stable ? 'ga' : 'ea' ;
if ( _actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .isDebug */ . _o ( ) ) {
console . time ( 'Retrieving available versions for Zulu took' ) ; // eslint-disable-line no-console
}
const baseRequestArguments = [
` os= ${ platform } ` ,
` archive_type= ${ extension } ` ,
` java_package_type= ${ bundleType } ` ,
` javafx_bundled= ${ javafx } ` ,
` crac_supported= ${ crac } ` ,
` arch= ${ arch } ` ,
` release_status= ${ releaseStatus } ` ,
` availability_types=ca `
] . join ( '&' ) ;
// Need to iterate through all pages to retrieve the list of all versions.
// The Azul API doesn't return a total page count, so paginate until a page
// comes back empty (or short), guarding against a runaway loop with a cap.
const pageSize = 100 ;
const maxPages = 100 ;
let pageIndex = 1 ;
const availableVersions = [ ] ;
while ( pageIndex <= maxPages ) {
const requestArguments = ` ${ baseRequestArguments } &page= ${ pageIndex } &page_size= ${ pageSize } ` ;
const availableVersionsUrl = ` https://api.azul.com/metadata/v1/zulu/packages/? ${ requestArguments } ` ;
if ( _actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .isDebug */ . _o ( ) && pageIndex === 1 ) {
// the url is identical except for the page number, so print it once for debug
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Gathering available versions from ' ${ availableVersionsUrl } ' ` ) ;
}
const paginationPage = ( await this . http . getJson ( availableVersionsUrl ) ) . result ;
if ( ! paginationPage || paginationPage . length === 0 ) {
// stop paginating because we have reached the end of the results
break ;
}
availableVersions . push ( ... paginationPage ) ;
if ( paginationPage . length < pageSize ) {
// a short page means this was the last one; avoid an extra empty request
break ;
}
pageIndex ++ ;
}
if ( pageIndex > maxPages ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .warning */ . $e ( ` Reached the maximum of ${ maxPages } pages while listing Zulu versions; results may be truncated. ` ) ;
}
if ( _actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .isDebug */ . _o ( ) ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .startGroup */ . Oh ( 'Print information about available versions' ) ;
console . timeEnd ( 'Retrieving available versions for Zulu took' ) ; // eslint-disable-line no-console
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Available versions: [ ${ availableVersions . length } ] ` ) ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( availableVersions . map ( item => item . java _version . join ( '.' ) ) . join ( ', ' ) ) ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .endGroup */ . N4 ( ) ;
}
return availableVersions ;
}
getArchitectureOptions ( ) {
const arch = this . distributionArchitecture ( ) ;
switch ( arch ) {
case 'x64' :
return 'x64' ;
case 'x86' :
// The Azul Metadata API's "x86" value returns both 32-bit (i686) and
// 64-bit (x64) packages, which are indistinguishable by version and
// would let a 32-bit request resolve to a 64-bit JDK. Use "i686" to
// target only genuine 32-bit builds, matching the legacy API behavior.
return 'i686' ;
case 'armv7' :
return 'arm' ;
case 'aarch64' :
case 'arm64' :
return 'aarch64' ;
default :
return arch ;
}
}
getPlatformOption ( ) {
// Azul has own platform names so need to map them
switch ( process . platform ) {
case 'darwin' :
return 'macos' ;
case 'win32' :
return 'windows' ;
case 'linux' :
2026-08-05 12:54:41 -04:00
// The new Metadata API's "linux" value returns both glibc and musl
// packages, so target the libc the runner actually has. A glibc JDK
// cannot run on Alpine.
2026-10-02 00:07:25 -04:00
return ( 0 , _platform _types _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ /* .isAlpineLinux */ . G6 ) ( ) ? 'linux_musl' : 'linux_glibc' ;
2026-07-29 17:53:33 -04:00
default :
return process . platform ;
}
}
}
/***/ } )
} ;