@@ -123578,9 +123578,12 @@ class AdoptDistribution extends base_installer_1.JavaBase {
123578123578 downloadTool(javaRelease) {
123579123579 return __awaiter(this, void 0, void 0, function* () {
123580123580 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
123581- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
123581+ let javaArchivePath = yield tc.downloadTool(javaRelease.url);
123582123582 core.info(`Extracting Java archive...`);
123583123583 const extension = (0, util_1.getDownloadArchiveExtension)();
123584+ if (process.platform === 'win32') {
123585+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
123586+ }
123584123587 const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
123585123588 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
123586123589 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -123914,9 +123917,13 @@ class CorrettoDistribution extends base_installer_1.JavaBase {
123914123917 downloadTool(javaRelease) {
123915123918 return __awaiter(this, void 0, void 0, function* () {
123916123919 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
123917- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
123920+ let javaArchivePath = yield tc.downloadTool(javaRelease.url);
123918123921 core.info(`Extracting Java archive...`);
123919- const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, (0, util_1.getDownloadArchiveExtension)());
123922+ const extension = (0, util_1.getDownloadArchiveExtension)();
123923+ if (process.platform === 'win32') {
123924+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
123925+ }
123926+ const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
123920123927 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
123921123928 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
123922123929 const version = this.getToolcacheVersionName(javaRelease.version);
@@ -124209,9 +124216,13 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
124209124216 downloadTool(javaRelease) {
124210124217 return __awaiter(this, void 0, void 0, function* () {
124211124218 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
124212- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
124219+ let javaArchivePath = yield tc.downloadTool(javaRelease.url);
124213124220 core.info(`Extracting Java archive...`);
124214- const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, (0, util_1.getDownloadArchiveExtension)());
124221+ const extension = (0, util_1.getDownloadArchiveExtension)();
124222+ if (process.platform === 'win32') {
124223+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
124224+ }
124225+ const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124215124226 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
124216124227 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
124217124228 const version = this.getToolcacheVersionName(javaRelease.version);
@@ -124375,9 +124386,12 @@ class GraalVMDistribution extends base_installer_1.JavaBase {
124375124386 downloadTool(javaRelease) {
124376124387 return __awaiter(this, void 0, void 0, function* () {
124377124388 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
124378- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
124389+ let javaArchivePath = yield tc.downloadTool(javaRelease.url);
124379124390 core.info(`Extracting Java archive...`);
124380124391 const extension = (0, util_1.getDownloadArchiveExtension)();
124392+ if (process.platform === 'win32') {
124393+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
124394+ }
124381124395 const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124382124396 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
124383124397 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -124543,11 +124557,8 @@ class LibericaDistributions extends base_installer_1.JavaBase {
124543124557 let javaArchivePath = yield tc.downloadTool(javaRelease.url);
124544124558 core.info(`Extracting Java archive...`);
124545124559 const extension = (0, util_1.getDownloadArchiveExtension)();
124546- if (process.platform === 'win32' &&
124547- (this.architecture === 'arm64' || this.architecture === 'aarch64')) {
124548- const javaArchivePathRenamed = `${javaArchivePath}.zip`;
124549- yield fs_1.default.renameSync(javaArchivePath, javaArchivePathRenamed);
124550- javaArchivePath = javaArchivePathRenamed;
124560+ if (process.platform === 'win32') {
124561+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
124551124562 }
124552124563 const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124553124564 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
@@ -124829,19 +124840,11 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
124829124840 return __awaiter(this, void 0, void 0, function* () {
124830124841 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
124831124842 let javaArchivePath = yield tc.downloadTool(javaRelease.url);
124832- // Rename archive to add extension because after downloading
124833- // archive does not contain extension type and it leads to some issues
124834- // on Windows runners without PowerShell Core.
124835- //
124836- // For default PowerShell Windows it should contain extension type to unpack it.
124837- if (process.platform === 'win32' &&
124838- (this.architecture === 'arm64' || this.architecture === 'aarch64')) {
124839- const javaArchivePathRenamed = `${javaArchivePath}.zip`;
124840- yield fs_1.default.renameSync(javaArchivePath, javaArchivePathRenamed);
124841- javaArchivePath = javaArchivePathRenamed;
124842- }
124843124843 core.info(`Extracting Java archive...`);
124844124844 const extension = (0, util_1.getDownloadArchiveExtension)();
124845+ if (process.platform === 'win32') {
124846+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
124847+ }
124845124848 const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124846124849 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
124847124850 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -124978,9 +124981,12 @@ class OracleDistribution extends base_installer_1.JavaBase {
124978124981 downloadTool(javaRelease) {
124979124982 return __awaiter(this, void 0, void 0, function* () {
124980124983 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
124981- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
124984+ let javaArchivePath = yield tc.downloadTool(javaRelease.url);
124982124985 core.info(`Extracting Java archive...`);
124983124986 const extension = (0, util_1.getDownloadArchiveExtension)();
124987+ if (process.platform === 'win32') {
124988+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
124989+ }
124984124990 const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124985124991 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
124986124992 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -125151,9 +125157,13 @@ class SapMachineDistribution extends base_installer_1.JavaBase {
125151125157 downloadTool(javaRelease) {
125152125158 return __awaiter(this, void 0, void 0, function* () {
125153125159 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
125154- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
125160+ let javaArchivePath = yield tc.downloadTool(javaRelease.url);
125155125161 core.info(`Extracting Java archive...`);
125156- const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, (0, util_1.getDownloadArchiveExtension)());
125162+ const extension = (0, util_1.getDownloadArchiveExtension)();
125163+ if (process.platform === 'win32') {
125164+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
125165+ }
125166+ const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
125157125167 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
125158125168 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
125159125169 const version = this.getToolcacheVersionName(javaRelease.version);
@@ -125370,9 +125380,12 @@ class SemeruDistribution extends base_installer_1.JavaBase {
125370125380 downloadTool(javaRelease) {
125371125381 return __awaiter(this, void 0, void 0, function* () {
125372125382 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
125373- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
125383+ let javaArchivePath = yield tc.downloadTool(javaRelease.url);
125374125384 core.info(`Extracting Java archive...`);
125375125385 const extension = (0, util_1.getDownloadArchiveExtension)();
125386+ if (process.platform === 'win32') {
125387+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
125388+ }
125376125389 const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
125377125390 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
125378125391 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -125546,9 +125559,12 @@ class TemurinDistribution extends base_installer_1.JavaBase {
125546125559 downloadTool(javaRelease) {
125547125560 return __awaiter(this, void 0, void 0, function* () {
125548125561 core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
125549- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
125562+ let javaArchivePath = yield tc.downloadTool(javaRelease.url);
125550125563 core.info(`Extracting Java archive...`);
125551125564 const extension = (0, util_1.getDownloadArchiveExtension)();
125565+ if (process.platform === 'win32') {
125566+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
125567+ }
125552125568 const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
125553125569 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
125554125570 const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -125724,11 +125740,8 @@ class ZuluDistribution extends base_installer_1.JavaBase {
125724125740 let javaArchivePath = yield tc.downloadTool(javaRelease.url);
125725125741 core.info(`Extracting Java archive...`);
125726125742 const extension = (0, util_1.getDownloadArchiveExtension)();
125727- if (process.platform === 'win32' &&
125728- (this.architecture === 'arm64' || this.architecture === 'aarch64')) {
125729- const javaArchivePathRenamed = `${javaArchivePath}.zip`;
125730- yield fs_1.default.renameSync(javaArchivePath, javaArchivePathRenamed);
125731- javaArchivePath = javaArchivePathRenamed;
125743+ if (process.platform === 'win32') {
125744+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
125732125745 }
125733125746 const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
125734125747 const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
@@ -126233,7 +126246,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
126233126246 return (mod && mod.__esModule) ? mod : { "default": mod };
126234126247};
126235126248Object.defineProperty(exports, "__esModule", ({ value: true }));
126236- exports.getGitHubHttpHeaders = exports.convertVersionToSemver = exports.getVersionFromFileContent = exports.isCacheFeatureAvailable = exports.isGhes = exports.isJobStatusSuccess = exports.getToolcachePath = exports.isVersionSatisfies = exports.getDownloadArchiveExtension = exports.extractJdkFile = exports.getVersionFromToolcachePath = exports.getBooleanInput = exports.getTempDir = void 0;
126249+ exports.renameWinArchive = exports. getGitHubHttpHeaders = exports.convertVersionToSemver = exports.getVersionFromFileContent = exports.isCacheFeatureAvailable = exports.isGhes = exports.isJobStatusSuccess = exports.getToolcachePath = exports.isVersionSatisfies = exports.getDownloadArchiveExtension = exports.extractJdkFile = exports.getVersionFromToolcachePath = exports.getBooleanInput = exports.getTempDir = void 0;
126237126250const os_1 = __importDefault(__nccwpck_require__(22037));
126238126251const path_1 = __importDefault(__nccwpck_require__(71017));
126239126252const fs = __importStar(__nccwpck_require__(57147));
@@ -126393,6 +126406,17 @@ function getGitHubHttpHeaders() {
126393126406 return headers;
126394126407}
126395126408exports.getGitHubHttpHeaders = getGitHubHttpHeaders;
126409+ // Rename archive to add extension because after downloading
126410+ // archive does not contain extension type and it leads to some issues
126411+ // on Windows runners without PowerShell Core.
126412+ //
126413+ // For default PowerShell Windows it should contain extension type to unpack it.
126414+ function renameWinArchive(javaArchivePath) {
126415+ const javaArchivePathRenamed = `${javaArchivePath}.zip`;
126416+ fs.renameSync(javaArchivePath, javaArchivePathRenamed);
126417+ return javaArchivePathRenamed;
126418+ }
126419+ exports.renameWinArchive = renameWinArchive;
126396126420
126397126421
126398126422/***/ }),
0 commit comments