Skip to content

Commit

Permalink
Merge pull request #667 from marcprux/main
Browse files Browse the repository at this point in the history
Support Swift 5.10
  • Loading branch information
fwal authored Mar 12, 2024
2 parents cdbe0f7 + 691b6b7 commit 92f3eaf
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
swift: ["5.9.2"]
swift: ["5.10"]
include:
- os: macos-12
swift: "5.9.2"
swift: "5.10"
- os: ubuntu-22.04
swift: "5.9.2"
swift: "5.10"
- os: windows-latest
swift: "5.6.3"
steps:
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.9.2"]
swift: ["5.10"]
steps:
- uses: swift-actions/setup-swift@v1
with:
Expand All @@ -25,7 +25,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
swift: ["5.9.2"]
swift: ["5.10"]
steps:
- uses: swift-actions/setup-swift@main
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ lib/

# next.js build output
.next

# vi swap file
.*.swp
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Ubuntu%20%7C%20Windows-lightgray" alt="Supports macOS, Ubuntu & Windows" />
</a>
<a href="https://swift.org">
<img src="https://img.shields.io/badge/Swift-5.9.2-F05138?logo=swift&logoColor=white" alt="Swift 5.9.2" />
<img src="https://img.shields.io/badge/Swift-5.10-F05138?logo=swift&logoColor=white" alt="Swift 5.10" />
</a>
<a href="https://github.com/swift-actions/setup-swift/releases/latest">
<img src="https://img.shields.io/github/v/release/swift-actions/setup-swift?sort=semver" alt="Latest release" />
Expand All @@ -28,7 +28,7 @@ After the environment is configured you can run swift commands using the standar
```yaml
- uses: swift-actions/setup-swift@v1
- name: Get swift version
run: swift --version # Swift 5.9.2
run: swift --version # Swift 5.10
```

A specific Swift version can be set using the `swift-version` input:
Expand Down Expand Up @@ -68,7 +68,7 @@ For example, Swift is available as version `5.1` but using this as value for `sw
In other words specifying...
- `"5.1.0"` will resolve to version `5.1`
- `"5.1"` will resolve to latest patch version (aka `5.1.1`)
- `"5"` will resolve to latest minor and patch version (aka `5.9.2`)
- `"5"` will resolve to latest minor and patch version (aka `5.10`)

### Caveats

Expand Down
2 changes: 1 addition & 1 deletion __tests__/swift-versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("swift version resolver", () => {

it("identifies X versions", async () => {
const version = await versions.verify("5", macOS);
expect(version).toBe("5.9.2");
expect(version).toBe("5.10");
});

it("identifies versions based on system", async () => {
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
swift-version:
description: Swift version to configure
required: true
default: '5.9.2'
default: '5.10'
outputs:
version:
description: The full Swift version that was configured
Expand Down
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ const semver = __importStar(__nccwpck_require__(1383));
const core = __importStar(__nccwpck_require__(2186));
const os_1 = __nccwpck_require__(1855);
const VERSIONS_LIST = [
["5.10", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
["5.9.2", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
["5.9.1", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
["5.9", [os_1.OS.MacOS, os_1.OS.Ubuntu]],
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-swift",
"version": "1.26.0",
"version": "0.1.0",
"description": "Set up GitHub Actions workflow with Swift support",
"private": true,
"main": "lib/main.js",
Expand Down
1 change: 1 addition & 0 deletions src/swift-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as core from "@actions/core";
import { System, OS } from "./os";

const VERSIONS_LIST: [string, OS[]][] = [
["5.10", [OS.MacOS, OS.Ubuntu]],
["5.9.2", [OS.MacOS, OS.Ubuntu]],
["5.9.1", [OS.MacOS, OS.Ubuntu]],
["5.9", [OS.MacOS, OS.Ubuntu]],
Expand Down

0 comments on commit 92f3eaf

Please sign in to comment.