@@ -76,11 +76,27 @@ exports.refreshKeys = exports.verify = exports.setupKeys = void 0;
7676const exec_1 = __nccwpck_require__(1514);
7777const core = __importStar(__nccwpck_require__(2186));
7878const toolCache = __importStar(__nccwpck_require__(7784));
79- async function setupKeys() {
79+ const os_1 = __nccwpck_require__(1855);
80+ async function setupKeys(system) {
8081 core.debug("Fetching verification keys");
8182 let path = await toolCache.downloadTool("https://swift.org/keys/all-keys.asc");
82- core.debug("Importing verification keys");
83- await (0, exec_1.exec)(`gpg --import "${path}"`);
83+ if (system.os === os_1.OS.Ubuntu || system.os === os_1.OS.MacOS) {
84+ core.debug("Examining verification keys");
85+ await (0, exec_1.exec)(`file "${path}"`);
86+ const isPlaintext = await (0, exec_1.exec)(`gunzip --test "${path}"`, undefined, {
87+ silent: true,
88+ ignoreReturnCode: true,
89+ });
90+ core.debug("Importing verification keys");
91+ await (0, exec_1.exec)("bash", [
92+ "-c",
93+ `${isPlaintext ? "cat" : "zcat"} "${path}" | gpg --import`,
94+ ]);
95+ }
96+ if (system.os === os_1.OS.Windows) {
97+ core.debug("Importing verification keys");
98+ await (0, exec_1.exec)(`gpg --import "${path}"`);
99+ }
84100 core.debug("Refreshing keys");
85101 await refreshKeys();
86102}
@@ -165,7 +181,7 @@ async function install(version, system) {
165181 let swiftPath = toolCache.find(`swift-${system.name}`, version);
166182 if (swiftPath === null || swiftPath.trim().length == 0) {
167183 core.debug(`No matching installation found`);
168- await (0, gpg_1.setupKeys)();
184+ await (0, gpg_1.setupKeys)(system );
169185 const swiftPkg = (0, swift_versions_1.swiftPackage)(version, system);
170186 let { pkg, signature } = await download(swiftPkg);
171187 await (0, gpg_1.verify)(signature, pkg);
@@ -460,7 +476,12 @@ const semver = __importStar(__nccwpck_require__(1383));
460476const core = __importStar(__nccwpck_require__(2186));
461477const os_1 = __nccwpck_require__(1855);
462478const VERSIONS_LIST = [
463- ["6.1.0", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
479+ ["6.2.1", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
480+ ["6.2", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
481+ ["6.1.3", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
482+ ["6.1.2", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
483+ ["6.1.1", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
484+ ["6.1", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
464485 ["6.0.3", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
465486 ["6.0.2", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
466487 ["6.0.1", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
@@ -790,7 +811,7 @@ const toolCache = __importStar(__nccwpck_require__(7784));
790811const path = __importStar(__nccwpck_require__(1017));
791812const exec_1 = __nccwpck_require__(1514);
792813const swift_versions_1 = __nccwpck_require__(8263);
793- const gpg_1 = __nccwpck_require__(9060) ;
814+ //import { setupKeys, verify } from "./gpg" ;
794815const visual_studio_1 = __nccwpck_require__(5219);
795816async function install(version, system) {
796817 if (os.platform() !== "win32") {
@@ -801,9 +822,9 @@ async function install(version, system) {
801822 let swiftPath = toolCache.find(`swift-${system.name}`, version);
802823 if (swiftPath === null || swiftPath.trim().length == 0) {
803824 core.debug(`No cached installer found`);
804- await (0, gpg_1. setupKeys)( );
825+ // await setupKeys(system );
805826 let { exe, signature } = await download(swiftPkg);
806- await (0, gpg_1. verify) (signature, exe);
827+ // await verify(signature, exe);
807828 const exePath = await toolCache.cacheFile(exe, swiftPkg.name, `swift-${system.name}`, version);
808829 swiftPath = path.join(exePath, swiftPkg.name);
809830 }
0 commit comments