11/******/ (() => { // webpackBootstrap
22/******/ 	var __webpack_modules__ = ({
33
4+ /***/ 209:
5+ /***/ ((__unused_webpack_module, exports) => {
6+ 
7+ "use strict";
8+ 
9+ Object.defineProperty(exports, "__esModule", ({ value: true }));
10+ function getArch() {
11+     return process.arch;
12+ }
13+ exports["default"] = getArch;
14+ 
15+ 
16+ /***/ }),
17+ 
418/***/ 951:
519/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
620
@@ -372,6 +386,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
372386Object.defineProperty(exports, "__esModule", ({ value: true }));
373387exports.getSystem = exports.OS = void 0;
374388const getos_1 = __importDefault(__nccwpck_require__(6068));
389+ const arch_1 = __importDefault(__nccwpck_require__(209));
375390var OS;
376391(function (OS) {
377392    OS[OS["MacOS"] = 0] = "MacOS";
@@ -395,23 +410,41 @@ async function getSystem() {
395410            os ? resolve(os) : reject(error || "No OS detected");
396411        });
397412    });
413+     const arch = (0, arch_1.default)();
398414    let system;
399415    switch (detectedSystem.os) {
400416        case "darwin":
401-             system = { os: OS.MacOS, version: "latest", name: "macOS" };
417+             system = {
418+                 os: OS.MacOS,
419+                 version: "latest",
420+                 name: "macOS",
421+                 arch,
422+             };
402423            break;
403424        case "linux":
404425            if (detectedSystem.dist !== "Ubuntu") {
405-                 throw new Error(`"${detectedSystem.dist}" is not a supported linux distribution`);
426+                 throw new Error(`"${detectedSystem.dist}" is not a supported Linux distribution`);
427+             }
428+             if (arch !== "x64" && arch !== "arm64") {
429+                 throw new Error(`${arch} is not a supported architecture for Linux`);
406430            }
407431            system = {
408432                os: OS.Ubuntu,
409433                version: detectedSystem.release,
410434                name: "Ubuntu",
435+                 arch,
411436            };
412437            break;
413438        case "win32":
414-             system = { os: OS.Windows, version: "latest", name: "Windows" };
439+             if (arch !== "x64") {
440+                 throw new Error(`${arch} is not a supported architecture for Windows`);
441+             }
442+             system = {
443+                 os: OS.Windows,
444+                 version: "latest",
445+                 name: "Windows",
446+                 arch,
447+             };
415448            break;
416449        default:
417450            throw new Error(`"${detectedSystem.os}" is not a supported platform`);
@@ -542,7 +575,11 @@ function swiftPackage(version, system) {
542575            break;
543576        case os_1.OS.Ubuntu:
544577            platform = `ubuntu${system.version.replace(/\D/g, "")}`;
578+             if (system.arch === "arm64")
579+                 platform += "-aarch64";
545580            archiveName = `swift-${version}-RELEASE-ubuntu${system.version}`;
581+             if (system.arch === "arm64")
582+                 archiveName += "-aarch64";
546583            archiveFile = `${archiveName}.tar.gz`;
547584            break;
548585        case os_1.OS.Windows:
0 commit comments