Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
swift: ["6.1.0"]
swift: ["6.2"]
include:
- os: windows-latest
swift: "5.6.3"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
swift: ["5.10"]
swift: ["6.2"]
steps:
- uses: swift-actions/setup-swift@v2
with:
Expand All @@ -25,7 +25,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
swift: ["5.10"]
swift: ["6.2"]
steps:
- uses: swift-actions/setup-swift@main
with:
Expand Down
26 changes: 20 additions & 6 deletions src/gpg.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
import { exec } from "@actions/exec";
import * as core from "@actions/core";
import * as toolCache from "@actions/tool-cache";
import { OS, System } from "./os";

export async function setupKeys() {
export async function setupKeys(system: System) {
core.debug("Fetching verification keys");
let path = await toolCache.downloadTool(
"https://swift.org/keys/all-keys.asc"
);

core.debug("Examining verification keys");
await exec(`file "${path}"`);
const isPlaintext = await exec(`gunzip --test "${path}"`, undefined, { silent: true, ignoreReturnCode: true });
if (system.os === OS.Ubuntu || system.os === OS.MacOS) {
core.debug("Examining verification keys");
await exec(`file "${path}"`);
const isPlaintext = await exec(`gunzip --test "${path}"`, undefined, {
silent: true,
ignoreReturnCode: true,
});

core.debug("Importing verification keys");
await exec("bash", [
"-c",
`${isPlaintext ? "cat" : "zcat"} "${path}" | gpg --import`,
]);
}

core.debug("Importing verification keys");
await exec('bash', ['-c', `${isPlaintext ? "cat" : "zcat"} "${path}" | gpg --import`]);
if (system.os === OS.Windows) {
core.debug("Importing verification keys");
await exec(`gpg --import "${path}"`);
}

core.debug("Refreshing keys");
await refreshKeys();
Expand Down
2 changes: 1 addition & 1 deletion src/linux-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function install(version: string, system: System) {
if (swiftPath === null || swiftPath.trim().length == 0) {
core.debug(`No matching installation found`);

await setupKeys();
await setupKeys(system);

const swiftPkg = swiftPackage(version, system);
let { pkg, signature } = await download(swiftPkg);
Expand Down
7 changes: 6 additions & 1 deletion src/swift-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import * as core from "@actions/core";
import { System, OS } from "./os";

const VERSIONS_LIST: [string, OS[]][] = [
["6.1.0", [OS.MacOS, OS.Ubuntu]],
["6.2.1", [OS.MacOS, OS.Ubuntu]],
["6.2", [OS.MacOS, OS.Ubuntu]],
["6.1.3", [OS.MacOS, OS.Ubuntu]],
["6.1.2", [OS.MacOS, OS.Ubuntu]],
["6.1.1", [OS.MacOS, OS.Ubuntu]],
["6.1", [OS.MacOS, OS.Ubuntu]],
["6.0.3", [OS.MacOS, OS.Ubuntu]],
["6.0.2", [OS.MacOS, OS.Ubuntu]],
["6.0.1", [OS.MacOS, OS.Ubuntu]],
Expand Down
6 changes: 3 additions & 3 deletions src/windows-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as path from "path";
import { ExecOptions, exec } from "@actions/exec";
import { System } from "./os";
import { swiftPackage, Package } from "./swift-versions";
import { setupKeys, verify } from "./gpg";
//import { setupKeys, verify } from "./gpg";
import { setupVsTools } from "./visual-studio";

export async function install(version: string, system: System) {
Expand All @@ -21,10 +21,10 @@ export async function install(version: string, system: System) {
if (swiftPath === null || swiftPath.trim().length == 0) {
core.debug(`No cached installer found`);

await setupKeys();
//await setupKeys(system);

let { exe, signature } = await download(swiftPkg);
await verify(signature, exe);
//await verify(signature, exe);

const exePath = await toolCache.cacheFile(
exe,
Expand Down
Loading