Skip to content

Commit 7ca6abe

Browse files
committed
Bump version to 2.4.0
1 parent 482b581 commit 7ca6abe

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Ubuntu%20%7C%20Windows-lightgray" alt="Supports macOS, Ubuntu & Windows" />
88
</a>
99
<a href="https://swift.org">
10-
<img src="https://img.shields.io/badge/Swift-6.0.2-F05138?logo=swift&logoColor=white" alt="Swift 6.1.0" />
10+
<img src="https://img.shields.io/badge/Swift-6.2-F05138?logo=swift&logoColor=white" alt="Swift 6.2" />
1111
</a>
1212
<a href="https://github.com/swift-actions/setup-swift/releases/latest">
1313
<img src="https://img.shields.io/github/v/release/swift-actions/setup-swift?sort=semver" alt="Latest release" />
@@ -19,6 +19,7 @@
1919
> [!IMPORTANT]
2020
> 3.0 is coming, powered by Swiftly 🚀 - follow progress on https://github.com/swift-actions/setup-swift/pull/710
2121
22+
2223
## Usage
2324

2425
To run the action with the latest swift version available, simply add the action as a step in your workflow:
@@ -31,7 +32,7 @@ After the environment is configured you can run swift commands using the standar
3132
```yaml
3233
- uses: swift-actions/setup-swift@v2
3334
- name: Get swift version
34-
run: swift --version # Swift 6.1.0
35+
run: swift --version # Swift 6.2
3536
```
3637

3738
A specific Swift version can be set using the `swift-version` input:

dist/index.js

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,27 @@ exports.refreshKeys = exports.verify = exports.setupKeys = void 0;
7676
const exec_1 = __nccwpck_require__(1514);
7777
const core = __importStar(__nccwpck_require__(2186));
7878
const 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("Examining verification keys");
83-
await (0, exec_1.exec)(`file "${path}"`);
84-
const isPlaintext = await (0, exec_1.exec)(`gunzip --test "${path}"`, undefined, { silent: true, ignoreReturnCode: true });
85-
core.debug("Importing verification keys");
86-
await (0, exec_1.exec)('bash', ['-c', `${isPlaintext ? "cat" : "zcat"} "${path}" | gpg --import`]);
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+
}
87100
core.debug("Refreshing keys");
88101
await refreshKeys();
89102
}
@@ -168,7 +181,7 @@ async function install(version, system) {
168181
let swiftPath = toolCache.find(`swift-${system.name}`, version);
169182
if (swiftPath === null || swiftPath.trim().length == 0) {
170183
core.debug(`No matching installation found`);
171-
await (0, gpg_1.setupKeys)();
184+
await (0, gpg_1.setupKeys)(system);
172185
const swiftPkg = (0, swift_versions_1.swiftPackage)(version, system);
173186
let { pkg, signature } = await download(swiftPkg);
174187
await (0, gpg_1.verify)(signature, pkg);
@@ -463,7 +476,12 @@ const semver = __importStar(__nccwpck_require__(1383));
463476
const core = __importStar(__nccwpck_require__(2186));
464477
const os_1 = __nccwpck_require__(1855);
465478
const VERSIONS_LIST = [
466-
["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]],
467485
["6.0.3", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
468486
["6.0.2", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
469487
["6.0.1", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
@@ -793,7 +811,7 @@ const toolCache = __importStar(__nccwpck_require__(7784));
793811
const path = __importStar(__nccwpck_require__(1017));
794812
const exec_1 = __nccwpck_require__(1514);
795813
const swift_versions_1 = __nccwpck_require__(8263);
796-
const gpg_1 = __nccwpck_require__(9060);
814+
//import { setupKeys, verify } from "./gpg";
797815
const visual_studio_1 = __nccwpck_require__(5219);
798816
async function install(version, system) {
799817
if (os.platform() !== "win32") {
@@ -804,9 +822,9 @@ async function install(version, system) {
804822
let swiftPath = toolCache.find(`swift-${system.name}`, version);
805823
if (swiftPath === null || swiftPath.trim().length == 0) {
806824
core.debug(`No cached installer found`);
807-
await (0, gpg_1.setupKeys)();
825+
//await setupKeys(system);
808826
let { exe, signature } = await download(swiftPkg);
809-
await (0, gpg_1.verify)(signature, exe);
827+
//await verify(signature, exe);
810828
const exePath = await toolCache.cacheFile(exe, swiftPkg.name, `swift-${system.name}`, version);
811829
swiftPath = path.join(exePath, swiftPkg.name);
812830
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-swift",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"description": "Set up GitHub Actions workflow with Swift support",
55
"private": true,
66
"main": "lib/main.js",

0 commit comments

Comments
 (0)