diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 845d0358..404bf59a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" diff --git a/.github/workflows/stability.yml b/.github/workflows/stability.yml index fb3b979d..b8531f5f 100644 --- a/.github/workflows/stability.yml +++ b/.github/workflows/stability.yml @@ -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: @@ -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: diff --git a/src/gpg.ts b/src/gpg.ts index 68038744..15a9c00b 100644 --- a/src/gpg.ts +++ b/src/gpg.ts @@ -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(); diff --git a/src/linux-install.ts b/src/linux-install.ts index e57bf185..d0271e6f 100644 --- a/src/linux-install.ts +++ b/src/linux-install.ts @@ -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); diff --git a/src/swift-versions.ts b/src/swift-versions.ts index 7394f926..8923067c 100644 --- a/src/swift-versions.ts +++ b/src/swift-versions.ts @@ -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]], diff --git a/src/windows-install.ts b/src/windows-install.ts index 9e537697..bf8becf2 100644 --- a/src/windows-install.ts +++ b/src/windows-install.ts @@ -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) { @@ -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,