Skip to content

Commit 1c7b2db

Browse files
Fix: windows arm64 setup (#1126)
* Add condition to ensure ZIP extraction targets only Windows ARM64 official archives * Bumps micromatch from 4.0.5 to 4.0.8
1 parent 26961cf commit 1c7b2db

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

dist/setup/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -93883,7 +93883,7 @@ class BaseDistribution {
9388393883
}
9388493884
throw err;
9388593885
}
93886-
const toolPath = yield this.extractArchive(downloadPath, info);
93886+
const toolPath = yield this.extractArchive(downloadPath, info, true);
9388793887
core.info('Done');
9388893888
return toolPath;
9388993889
});
@@ -93933,7 +93933,7 @@ class BaseDistribution {
9393393933
return toolPath;
9393493934
});
9393593935
}
93936-
extractArchive(downloadPath, info) {
93936+
extractArchive(downloadPath, info, isOfficialArchive) {
9393793937
return __awaiter(this, void 0, void 0, function* () {
9393893938
//
9393993939
// Extract
@@ -93948,7 +93948,7 @@ class BaseDistribution {
9394893948
// on Windows runners without PowerShell Core.
9394993949
//
9395093950
// For default PowerShell Windows it should contain extension type to unpack it.
93951-
if (extension === '.zip') {
93951+
if (extension === '.zip' && isOfficialArchive) {
9395293952
const renamedArchive = `${downloadPath}.zip`;
9395393953
fs_1.default.renameSync(downloadPath, renamedArchive);
9395493954
extPath = yield tc.extractZip(renamedArchive);
@@ -94186,7 +94186,7 @@ class OfficialBuilds extends base_distribution_1.default {
9418694186
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`);
9418794187
downloadPath = yield tc.downloadTool(versionInfo.downloadUrl, undefined, this.nodeInfo.auth);
9418894188
if (downloadPath) {
94189-
toolPath = yield this.extractArchive(downloadPath, versionInfo);
94189+
toolPath = yield this.extractArchive(downloadPath, versionInfo, false);
9419094190
}
9419194191
}
9419294192
else {

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/distributions/base-distribution.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export default abstract class BaseDistribution {
150150
throw err;
151151
}
152152

153-
const toolPath = await this.extractArchive(downloadPath, info);
153+
const toolPath = await this.extractArchive(downloadPath, info, true);
154154
core.info('Done');
155155

156156
return toolPath;
@@ -210,7 +210,8 @@ export default abstract class BaseDistribution {
210210

211211
protected async extractArchive(
212212
downloadPath: string,
213-
info: INodeVersionInfo | null
213+
info: INodeVersionInfo | null,
214+
isOfficialArchive?: boolean
214215
) {
215216
//
216217
// Extract
@@ -225,7 +226,7 @@ export default abstract class BaseDistribution {
225226
// on Windows runners without PowerShell Core.
226227
//
227228
// For default PowerShell Windows it should contain extension type to unpack it.
228-
if (extension === '.zip') {
229+
if (extension === '.zip' && isOfficialArchive) {
229230
const renamedArchive = `${downloadPath}.zip`;
230231
fs.renameSync(downloadPath, renamedArchive);
231232
extPath = await tc.extractZip(renamedArchive);

src/distributions/official_builds/official_builds.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ export default class OfficialBuilds extends BaseDistribution {
8888
);
8989

9090
if (downloadPath) {
91-
toolPath = await this.extractArchive(downloadPath, versionInfo);
91+
toolPath = await this.extractArchive(
92+
downloadPath,
93+
versionInfo,
94+
false
95+
);
9296
}
9397
} else {
9498
core.info(

0 commit comments

Comments
 (0)