add comment

This commit is contained in:
Dmitry Shibanov 2023-12-21 15:49:13 +01:00
parent d98fd1728d
commit c2317c0941
2 changed files with 11 additions and 0 deletions

5
dist/setup/index.js vendored
View file

@ -123970,6 +123970,11 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
let javaArchivePath = yield tc.downloadTool(javaRelease.url); let javaArchivePath = yield tc.downloadTool(javaRelease.url);
core.info(`Extracting Java archive...`); core.info(`Extracting Java archive...`);
const extension = (0, util_1.getDownloadArchiveExtension)(); const extension = (0, util_1.getDownloadArchiveExtension)();
// Rename archive to add extension because after downloading
// archive does not contain extension type and it leads to some issues
// on Windows runners without PowerShell Core.
//
// For default PowerShell Windows it should contain extension type to unpack it.
if (process.platform === 'win32' && if (process.platform === 'win32' &&
(this.architecture === 'arm64' || this.architecture === 'aarch64')) { (this.architecture === 'arm64' || this.architecture === 'aarch64')) {
const javaArchivePathRenamed = `${javaArchivePath}.zip`; const javaArchivePathRenamed = `${javaArchivePath}.zip`;

View file

@ -30,6 +30,11 @@ export class MicrosoftDistributions extends JavaBase {
core.info(`Extracting Java archive...`); core.info(`Extracting Java archive...`);
const extension = getDownloadArchiveExtension(); const extension = getDownloadArchiveExtension();
// Rename archive to add extension because after downloading
// archive does not contain extension type and it leads to some issues
// on Windows runners without PowerShell Core.
//
// For default PowerShell Windows it should contain extension type to unpack it.
if ( if (
process.platform === 'win32' && process.platform === 'win32' &&
(this.architecture === 'arm64' || this.architecture === 'aarch64') (this.architecture === 'arm64' || this.architecture === 'aarch64')
@ -38,6 +43,7 @@ export class MicrosoftDistributions extends JavaBase {
await fs.renameSync(javaArchivePath, javaArchivePathRenamed); await fs.renameSync(javaArchivePath, javaArchivePathRenamed);
javaArchivePath = javaArchivePathRenamed; javaArchivePath = javaArchivePathRenamed;
} }
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension); const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
const archiveName = fs.readdirSync(extractedJavaPath)[0]; const archiveName = fs.readdirSync(extractedJavaPath)[0];