@@ -123578,9 +123578,12 @@ class AdoptDistribution extends base_installer_1.JavaBase {
123578
123578
downloadTool(javaRelease) {
123579
123579
return __awaiter(this, void 0, void 0, function* () {
123580
123580
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);
123582
123582
core.info(`Extracting Java archive...`);
123583
123583
const extension = (0, util_1.getDownloadArchiveExtension)();
123584
+ if (process.platform === 'win32') {
123585
+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
123586
+ }
123584
123587
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
123585
123588
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
123586
123589
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -123914,9 +123917,13 @@ class CorrettoDistribution extends base_installer_1.JavaBase {
123914
123917
downloadTool(javaRelease) {
123915
123918
return __awaiter(this, void 0, void 0, function* () {
123916
123919
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);
123918
123921
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);
123920
123927
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
123921
123928
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
123922
123929
const version = this.getToolcacheVersionName(javaRelease.version);
@@ -124209,9 +124216,13 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
124209
124216
downloadTool(javaRelease) {
124210
124217
return __awaiter(this, void 0, void 0, function* () {
124211
124218
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);
124213
124220
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);
124215
124226
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
124216
124227
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
124217
124228
const version = this.getToolcacheVersionName(javaRelease.version);
@@ -124375,9 +124386,12 @@ class GraalVMDistribution extends base_installer_1.JavaBase {
124375
124386
downloadTool(javaRelease) {
124376
124387
return __awaiter(this, void 0, void 0, function* () {
124377
124388
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);
124379
124390
core.info(`Extracting Java archive...`);
124380
124391
const extension = (0, util_1.getDownloadArchiveExtension)();
124392
+ if (process.platform === 'win32') {
124393
+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
124394
+ }
124381
124395
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124382
124396
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
124383
124397
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -124543,11 +124557,8 @@ class LibericaDistributions extends base_installer_1.JavaBase {
124543
124557
let javaArchivePath = yield tc.downloadTool(javaRelease.url);
124544
124558
core.info(`Extracting Java archive...`);
124545
124559
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);
124551
124562
}
124552
124563
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124553
124564
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
@@ -124829,19 +124840,11 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
124829
124840
return __awaiter(this, void 0, void 0, function* () {
124830
124841
core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
124831
124842
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
- }
124843
124843
core.info(`Extracting Java archive...`);
124844
124844
const extension = (0, util_1.getDownloadArchiveExtension)();
124845
+ if (process.platform === 'win32') {
124846
+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
124847
+ }
124845
124848
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124846
124849
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
124847
124850
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -124978,9 +124981,12 @@ class OracleDistribution extends base_installer_1.JavaBase {
124978
124981
downloadTool(javaRelease) {
124979
124982
return __awaiter(this, void 0, void 0, function* () {
124980
124983
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);
124982
124985
core.info(`Extracting Java archive...`);
124983
124986
const extension = (0, util_1.getDownloadArchiveExtension)();
124987
+ if (process.platform === 'win32') {
124988
+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
124989
+ }
124984
124990
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
124985
124991
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
124986
124992
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -125151,9 +125157,13 @@ class SapMachineDistribution extends base_installer_1.JavaBase {
125151
125157
downloadTool(javaRelease) {
125152
125158
return __awaiter(this, void 0, void 0, function* () {
125153
125159
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);
125155
125161
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);
125157
125167
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
125158
125168
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
125159
125169
const version = this.getToolcacheVersionName(javaRelease.version);
@@ -125370,9 +125380,12 @@ class SemeruDistribution extends base_installer_1.JavaBase {
125370
125380
downloadTool(javaRelease) {
125371
125381
return __awaiter(this, void 0, void 0, function* () {
125372
125382
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);
125374
125384
core.info(`Extracting Java archive...`);
125375
125385
const extension = (0, util_1.getDownloadArchiveExtension)();
125386
+ if (process.platform === 'win32') {
125387
+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
125388
+ }
125376
125389
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
125377
125390
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
125378
125391
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -125546,9 +125559,12 @@ class TemurinDistribution extends base_installer_1.JavaBase {
125546
125559
downloadTool(javaRelease) {
125547
125560
return __awaiter(this, void 0, void 0, function* () {
125548
125561
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);
125550
125563
core.info(`Extracting Java archive...`);
125551
125564
const extension = (0, util_1.getDownloadArchiveExtension)();
125565
+ if (process.platform === 'win32') {
125566
+ javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
125567
+ }
125552
125568
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
125553
125569
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
125554
125570
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
@@ -125724,11 +125740,8 @@ class ZuluDistribution extends base_installer_1.JavaBase {
125724
125740
let javaArchivePath = yield tc.downloadTool(javaRelease.url);
125725
125741
core.info(`Extracting Java archive...`);
125726
125742
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);
125732
125745
}
125733
125746
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
125734
125747
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
@@ -126233,7 +126246,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
126233
126246
return (mod && mod.__esModule) ? mod : { "default": mod };
126234
126247
};
126235
126248
Object.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;
126237
126250
const os_1 = __importDefault(__nccwpck_require__(22037));
126238
126251
const path_1 = __importDefault(__nccwpck_require__(71017));
126239
126252
const fs = __importStar(__nccwpck_require__(57147));
@@ -126393,6 +126406,17 @@ function getGitHubHttpHeaders() {
126393
126406
return headers;
126394
126407
}
126395
126408
exports.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;
126396
126420
126397
126421
126398
126422
/***/ }),
0 commit comments