@@ -93110,7 +93110,11 @@ class BaseDistribution {
93110
93110
const fileName = this.osPlat == 'win32'
93111
93111
? `node-v${version}-win-${osArch}`
93112
93112
: `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`;
93114
93118
const initialUrl = this.getDistributionUrl();
93115
93119
const url = `${initialUrl}/v${version}/${urlFileName}`;
93116
93120
return {
@@ -93194,10 +93198,23 @@ class BaseDistribution {
93194
93198
let extPath;
93195
93199
info = info || {}; // satisfy compiler, never null when reaches here
93196
93200
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
+ }
93199
93216
// 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 ));
93201
93218
if (fs_1.default.existsSync(nestedPath)) {
93202
93219
extPath = nestedPath;
93203
93220
}
@@ -93229,7 +93246,12 @@ class BaseDistribution {
93229
93246
dataFileName = `osx-${osArch}-tar`;
93230
93247
break;
93231
93248
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
+ }
93233
93255
break;
93234
93256
default:
93235
93257
throw new Error(`Unexpected OS '${this.osPlat}'`);
@@ -93783,6 +93805,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
93783
93805
exports.unique = exports.printEnvDetailsAndSetOutput = exports.getNodeVersionFromFile = void 0;
93784
93806
const core = __importStar(__nccwpck_require__(2186));
93785
93807
const exec = __importStar(__nccwpck_require__(1514));
93808
+ const io = __importStar(__nccwpck_require__(7436));
93786
93809
const fs_1 = __importDefault(__nccwpck_require__(7147));
93787
93810
const path_1 = __importDefault(__nccwpck_require__(1017));
93788
93811
function getNodeVersionFromFile(versionFilePath) {
@@ -93834,7 +93857,8 @@ function printEnvDetailsAndSetOutput() {
93834
93857
return __awaiter(this, void 0, void 0, function* () {
93835
93858
core.startGroup('Environment details');
93836
93859
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']) : '';
93838
93862
return { tool, output };
93839
93863
}));
93840
93864
const tools = yield Promise.all(promises);
0 commit comments