@@ -93110,7 +93110,11 @@ class BaseDistribution {
9311093110 const fileName = this.osPlat == 'win32'
9311193111 ? `node-v${version}-win-${osArch}`
9311293112 : `node-v${version}-${this.osPlat}-${osArch}`;
93113- const urlFileName = this.osPlat == 'win32' ? `${fileName}.7z` : `${fileName}.tar.gz`;
93113+ const urlFileName = this.osPlat == 'win32'
93114+ ? this.nodeInfo.arch === 'arm64'
93115+ ? `${fileName}.zip`
93116+ : `${fileName}.7z`
93117+ : `${fileName}.tar.gz`;
9311493118 const initialUrl = this.getDistributionUrl();
9311593119 const url = `${initialUrl}/v${version}/${urlFileName}`;
9311693120 return {
@@ -93194,10 +93198,23 @@ class BaseDistribution {
9319493198 let extPath;
9319593199 info = info || {}; // satisfy compiler, never null when reaches here
9319693200 if (this.osPlat == 'win32') {
93197- const _7zPath = path.join(__dirname, '../..', 'externals', '7zr.exe');
93198- extPath = yield tc.extract7z(downloadPath, undefined, _7zPath);
93201+ const extension = this.nodeInfo.arch === 'arm64' ? '.zip' : '.7z';
93202+ // Rename archive to add extension because after downloading
93203+ // archive does not contain extension type and it leads to some issues
93204+ // on Windows runners without PowerShell Core.
93205+ //
93206+ // For default PowerShell Windows it should contain extension type to unpack it.
93207+ if (extension === '.zip') {
93208+ const renamedArchive = `${downloadPath}.zip`;
93209+ fs_1.default.renameSync(downloadPath, renamedArchive);
93210+ extPath = yield tc.extractZip(renamedArchive);
93211+ }
93212+ else {
93213+ const _7zPath = path.join(__dirname, '../..', 'externals', '7zr.exe');
93214+ extPath = yield tc.extract7z(downloadPath, undefined, _7zPath);
93215+ }
9319993216 // 7z extracts to folder matching file name
93200- const nestedPath = path.join(extPath, path.basename(info.fileName, '.7z' ));
93217+ const nestedPath = path.join(extPath, path.basename(info.fileName, extension ));
9320193218 if (fs_1.default.existsSync(nestedPath)) {
9320293219 extPath = nestedPath;
9320393220 }
@@ -93229,7 +93246,12 @@ class BaseDistribution {
9322993246 dataFileName = `osx-${osArch}-tar`;
9323093247 break;
9323193248 case 'win32':
93232- dataFileName = `win-${osArch}-exe`;
93249+ if (this.nodeInfo.arch === 'arm64') {
93250+ dataFileName = `win-${osArch}-zip`;
93251+ }
93252+ else {
93253+ dataFileName = `win-${osArch}-exe`;
93254+ }
9323393255 break;
9323493256 default:
9323593257 throw new Error(`Unexpected OS '${this.osPlat}'`);
@@ -93783,6 +93805,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
9378393805exports.unique = exports.printEnvDetailsAndSetOutput = exports.getNodeVersionFromFile = void 0;
9378493806const core = __importStar(__nccwpck_require__(2186));
9378593807const exec = __importStar(__nccwpck_require__(1514));
93808+ const io = __importStar(__nccwpck_require__(7436));
9378693809const fs_1 = __importDefault(__nccwpck_require__(7147));
9378793810const path_1 = __importDefault(__nccwpck_require__(1017));
9378893811function getNodeVersionFromFile(versionFilePath) {
@@ -93834,7 +93857,8 @@ function printEnvDetailsAndSetOutput() {
9383493857 return __awaiter(this, void 0, void 0, function* () {
9383593858 core.startGroup('Environment details');
9383693859 const promises = ['node', 'npm', 'yarn'].map((tool) => __awaiter(this, void 0, void 0, function* () {
93837- const output = yield getToolVersion(tool, ['--version']);
93860+ const pathTool = yield io.which(tool, false);
93861+ const output = pathTool ? yield getToolVersion(tool, ['--version']) : '';
9383893862 return { tool, output };
9383993863 }));
9384093864 const tools = yield Promise.all(promises);
0 commit comments