Skip to content

Commit 410d97d

Browse files
Merge branch 'main' into louis/self-uninstall
2 parents dc42197 + d7d77d6 commit 410d97d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3392
-794
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Smoke Test - 6.2 Nightly Swift Toolchain
2+
3+
on:
4+
schedule:
5+
- cron: '30 2 * * *'
6+
7+
jobs:
8+
tests-selfhosted-linux:
9+
name: Test (Smoke Test - 6.2 Nightly Swift Toolchain) / ${{ matrix.container }}
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
container: ["ubuntu:22.04", "ubuntu:24.04", "redhat/ubi9", "debian:12"]
15+
container:
16+
image: ${{ matrix.container }}
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
- name: Prepare the action
21+
run: ./scripts/prep-gh-action.sh --install-swiftly --swift-snapshot 6.2
22+
- name: Build and Test
23+
# UBI 9 - See https://github.com/swiftlang/swift/issues/80908
24+
# UBI 9 - See https://github.com/swiftlang/swift/issues/80909
25+
run: bash -c 'if [[ "${{ matrix.container }}" == "redhat/ubi9" ]]; then swiftly run +6.2-snapshot swift build --build-tests; else swiftly run +6.2-snapshot swift test; fi'
26+
27+
tests-selfhosted-macos:
28+
name: Test (Smoke Test - Nightly Swift Toolchain) / macOS Sequoia ARM64
29+
runs-on: [self-hosted, macos, sequoia, ARM64]
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
- name: Prepare the action
34+
run: ./scripts/prep-gh-action.sh --install-swiftly --swift-snapshot 6.2
35+
- name: Build and Test
36+
run: swiftly run +6.2-snapshot swift test

.github/workflows/build_release.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ env:
1818
SWIFTLY_BOOTSTRAP_VERSION: 1.0.0
1919

2020
jobs:
21-
buildrelease:
22-
name: Build Release
21+
buildrelease-linux:
22+
name: Build Release / Linux x86_64
2323
runs-on: ubuntu-latest
2424
container:
2525
image: "redhat/ubi9"
@@ -44,3 +44,20 @@ jobs:
4444
name: swiftly-docs
4545
path: .build/docs/**
4646
if-no-files-found: error
47+
48+
buildrelease-macos:
49+
name: Build Release / macOS
50+
runs-on: [self-hosted, macos, sequoia, ARM64]
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v4
54+
- name: Prepare the action
55+
run: ./scripts/prep-gh-action.sh --install-swiftly
56+
- name: Build Release Artifact
57+
run: swift run build-swiftly-release ${{ inputs.skip }} ${{ inputs.version }}
58+
- name: Upload Release Artifact
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: swiftly-release-x86_64
62+
path: .build/release/swiftly-*.tar.gz
63+
if-no-files-found: error

.github/workflows/nightly_snapshot_check.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,33 @@ on:
44
schedule:
55
- cron: '30 3 * * *'
66

7-
env:
8-
SWIFTLY_BOOTSTRAP_VERSION: 1.0.0
9-
107
jobs:
11-
tests-selfhosted:
8+
tests-selfhosted-linux:
129
name: Test (Smoke Test - Nightly Swift Toolchain) / ${{ matrix.container }}
1310
runs-on: ubuntu-latest
1411
strategy:
1512
fail-fast: false
1613
matrix:
17-
container: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "redhat/ubi9", "debian:12", "fedora:39"]
14+
container: ["ubuntu:22.04", "ubuntu:24.04", "redhat/ubi9", "debian:12"]
1815
container:
1916
image: ${{ matrix.container }}
2017
steps:
2118
- name: Checkout repository
2219
uses: actions/checkout@v4
2320
- name: Prepare the action
24-
run: ./scripts/prep-gh-action.sh --install-swiftly --swift-main-snapshot
21+
run: ./scripts/prep-gh-action.sh --install-swiftly --swift-snapshot main
2522
- name: Build and Test
26-
# UBI 9 and Ubuntu 20.04 - See https://github.com/swiftlang/swift/issues/80908
23+
# UBI 9 - See https://github.com/swiftlang/swift/issues/80908
2724
# UBI 9 - See https://github.com/swiftlang/swift/issues/80909
28-
run: bash -c 'if [[ "${{ matrix.container }}" == "redhat/ubi9" ]]; then swiftly run +main-snapshot swift build --build-tests; elif [[ "${{ matrix.container }}" == "ubuntu:20.04" ]]; then swiftly run +main-snapshot swift build --build-tests; else swiftly run +main-snapshot swift test; fi'
25+
run: bash -c 'if [[ "${{ matrix.container }}" == "redhat/ubi9" ]]; then swiftly run +main-snapshot swift build --build-tests; else swiftly run +main-snapshot swift test; fi'
26+
27+
tests-selfhosted-macos:
28+
name: Test (Smoke Test - Nightly Swift Toolchain) / macOS Sequoia ARM64
29+
runs-on: [self-hosted, macos, sequoia, ARM64]
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
- name: Prepare the action
34+
run: ./scripts/prep-gh-action.sh --install-swiftly --swift-snapshot main
35+
- name: Build and Test
36+
run: swiftly run +main-snapshot swift test

.github/workflows/pull_request.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
push:
77
branches: [main]
88

9-
env:
10-
SWIFTLY_BOOTSTRAP_VERSION: 1.0.0
11-
129
jobs:
1310
soundness:
1411
name: Soundness
@@ -22,13 +19,27 @@ jobs:
2219
shell_check_enabled: false
2320
unacceptable_language_check_enabled: true
2421

22+
macos-tests-selfhosted:
23+
name: Test (Self Hosted) / macOS Sequoia ARM64
24+
runs-on: [self-hosted, macos, sequoia, ARM64]
25+
strategy:
26+
fail-fast: false
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
- name: Prepare the action
31+
run: ./scripts/prep-gh-action.sh --install-swiftly
32+
- name: Build and Test
33+
run: swift test
34+
timeout-minutes: 60
35+
2536
tests-selfhosted:
2637
name: Test (Self Hosted) / ${{ matrix.container }}
2738
runs-on: ubuntu-latest
2839
strategy:
2940
fail-fast: false
3041
matrix:
31-
container: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "redhat/ubi9", "debian:12", "fedora:39"]
42+
container: ["ubuntu:22.04", "ubuntu:24.04", "redhat/ubi9", "debian:12", "fedora:39"]
3243
container:
3344
image: ${{ matrix.container }}
3445
steps:
@@ -37,12 +48,12 @@ jobs:
3748
- name: Prepare the action
3849
run: ./scripts/prep-gh-action.sh --install-swiftly
3950
- name: Build and Test
40-
# UBI 9 and Ubuntu 20.04 - See https://github.com/swiftlang/swift/issues/80908
51+
# UBI 9 - See https://github.com/swiftlang/swift/issues/80908
4152
# UBI 9 - See https://github.com/swiftlang/swift/issues/80909
42-
run: bash -c 'if [[ "${{ matrix.container }}" == "redhat/ubi9" ]]; then swift build --build-tests; elif [[ "${{ matrix.container }}" == "ubuntu:20.04" ]]; then swift build --build-tests; else swift test; fi'
53+
run: bash -c 'if [[ "${{ matrix.container }}" == "redhat/ubi9" ]]; then swift build --build-tests; else swift test; fi'
4354

4455
releasebuildcheck:
45-
name: Release Build Check
56+
name: Release Build Check / Linux
4657
runs-on: ubuntu-latest
4758
container:
4859
image: "redhat/ubi9"
@@ -63,11 +74,36 @@ jobs:
6374
- name: Upload Tests
6475
uses: actions/upload-artifact@v4
6576
with:
66-
name: swiftly-tests-x86_64
77+
name: test-swiftly-linux-x86_64
6778
path: .build/debug/test-swiftly-linux-x86_64.tar.gz
6879
if-no-files-found: error
6980
retention-days: 1
7081

82+
releasebuildcheckmacos:
83+
name: Release Build Check / macOS
84+
runs-on: [self-hosted, macos, sequoia, ARM64]
85+
steps:
86+
- name: Checkout repository
87+
uses: actions/checkout@v4
88+
- name: Prepare the action
89+
run: ./scripts/prep-gh-action.sh --install-swiftly
90+
- name: Build Artifact
91+
run: swift run build-swiftly-release --test --skip "999.0.0"
92+
- name: Upload Artifact
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: swiftly-release-darwin
96+
path: .build/release/swiftly-*.pkg
97+
if-no-files-found: error
98+
retention-days: 1
99+
- name: Upload Tests
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: test-swiftly-macos
103+
path: .build/release/test-swiftly-macos.tar.gz
104+
if-no-files-found: error
105+
retention-days: 1
106+
71107
releasetest:
72108
name: Test Release / ${{matrix.shell.pkg}}
73109
needs: releasebuildcheck
@@ -92,7 +128,7 @@ jobs:
92128
- name: Download Tests
93129
uses: actions/download-artifact@v4
94130
with:
95-
name: swiftly-tests-x86_64
131+
name: test-swiftly-linux-x86_64
96132
- name: Extract and Run Workflow Tests
97133
run: cp swiftly-*.tar.gz /root/swiftly.tar.gz && cp test-swiftly-*.tar.gz /root && cd /root && tar zxf test-swiftly-*.tar.gz && ./test-swiftly -y ./swiftly.tar.gz
98134

@@ -112,7 +148,7 @@ jobs:
112148
- name: Download Tests
113149
uses: actions/download-artifact@v4
114150
with:
115-
name: swiftly-tests-x86_64
151+
name: test-swiftly-linux-x86_64
116152
- name: Extract and Run Workflow Tests
117153
run: cp swiftly-*.tar.gz /root/swiftly.tar.gz && cp test-swiftly-*.tar.gz /root && cd /root && tar zxf test-swiftly-*.tar.gz && ./test-swiftly -y --custom-location ./swiftly.tar.gz
118154

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.1.0
1+
6.2.0

.unacceptablelanguageignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sources/SwiftlyCore/ProcessInfo.swift

Documentation/SwiftlyDocs.docc/shell-autocompletion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ swiftly --generate-completion-script <shell>
2121
Otherwise, you'll need to add a path for completion scripts to your function path, and turn on completion script autoloading. First, add these lines to ~/.zshrc:
2222

2323
```
24-
fpath=(~/.zsh/completion $fpath)
24+
fpath=(~/.zsh/completions $fpath)
2525
autoload -U compinit
2626
compinit
2727
```
2828

2929
Next, create the completion directory and add the swiftly completions to it:
3030

3131
```
32-
mkdir -p ~/.zsh/completion && swiftly --generate-completion-script zsh > ~/.zsh/completions/swiftly
32+
mkdir -p ~/.zsh/completions && swiftly --generate-completion-script zsh > ~/.zsh/completions/_swiftly
3333
```
3434
}
3535

Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ swiftly [--version] [--help]
2323
Install a new toolchain.
2424

2525
```
26-
swiftly install [<version>] [--use] [--verify|no-verify] [--post-install-file=<post-install-file>] [--assume-yes] [--verbose] [--version] [--help]
26+
swiftly install [<version>] [--use] [--verify|no-verify] [--post-install-file=<post-install-file>] [--progress-file=<progress-file>] [--format=<format>] [--assume-yes] [--verbose] [--version] [--help]
2727
```
2828

2929
**version:**
@@ -80,6 +80,20 @@ If the toolchain that is installed has extra post installation steps, they will
8080
written to this file as commands that can be run after the installation.
8181

8282

83+
**--progress-file=\<progress-file\>:**
84+
85+
*A file path where progress information will be written in JSONL format*
86+
87+
Progress information will be appended to this file as JSON objects, one per line.
88+
Each progress entry contains timestamp, progress percentage, and a descriptive message.
89+
The file must be writable, else an error will be thrown.
90+
91+
92+
**--format=\<format\>:**
93+
94+
*Output format (text, json)*
95+
96+
8397
**--assume-yes:**
8498

8599
*Disable confirmation prompts by assuming 'yes'*
@@ -107,7 +121,7 @@ written to this file as commands that can be run after the installation.
107121
List toolchains available for install.
108122

109123
```
110-
swiftly list-available [<toolchain-selector>] [--version] [--help]
124+
swiftly list-available [<toolchain-selector>] [--format=<format>] [--version] [--help]
111125
```
112126

113127
**toolchain-selector:**
@@ -135,6 +149,11 @@ The installed snapshots for a given development branch can be listed by specifyi
135149
Note that listing available snapshots before the latest release (major and minor number) is unsupported.
136150

137151

152+
**--format=\<format\>:**
153+
154+
*Output format (text, json)*
155+
156+
138157
**--version:**
139158

140159
*Show the version.*
@@ -152,7 +171,7 @@ Note that listing available snapshots before the latest release (major and minor
152171
Set the in-use or default toolchain. If no toolchain is provided, print the currently in-use toolchain, if any.
153172

154173
```
155-
swiftly use [--print-location] [--global-default] [--assume-yes] [--verbose] [<toolchain>] [--version] [--help]
174+
swiftly use [--print-location] [--global-default] [--format=<format>] [--assume-yes] [--verbose] [<toolchain>] [--version] [--help]
156175
```
157176

158177
**--print-location:**
@@ -165,6 +184,11 @@ swiftly use [--print-location] [--global-default] [--assume-yes] [--verbose] [<t
165184
*Set the global default toolchain that is used when there are no .swift-version files.*
166185

167186

187+
**--format=\<format\>:**
188+
189+
*Output format (text, json)*
190+
191+
168192
**--assume-yes:**
169193

170194
*Disable confirmation prompts by assuming 'yes'*
@@ -206,6 +230,10 @@ Likewise, the latest snapshot associated with a given development branch can be
206230
$ swiftly use 5.7-snapshot
207231
$ swiftly use main-snapshot
208232

233+
macOS ONLY: There is a special selector for swiftly to use your Xcode toolchain. If there are multiple versions of Xcode then swiftly will use the currently selected toolchain from xcode-select.
234+
235+
$ swiftly use xcode
236+
209237

210238
**--version:**
211239

@@ -224,22 +252,26 @@ Likewise, the latest snapshot associated with a given development branch can be
224252
Remove an installed toolchain.
225253

226254
```
227-
swiftly uninstall <toolchain> [--assume-yes] [--verbose] [--version] [--help]
255+
swiftly uninstall <toolchains>... [--assume-yes] [--verbose] [--version] [--help]
228256
```
229257

230-
**toolchain:**
258+
**toolchains:**
231259

232260
*The toolchain(s) to uninstall.*
233261

234262

235-
The toolchain selector provided determines which toolchains to uninstall. Specific toolchains can be uninstalled by using their full names as the selector, for example a full stable release version with patch (a.b.c):
263+
The list of toolchain selectors determines which toolchains to uninstall. Specific toolchains can be uninstalled by using their full names as the selector, for example a full stable release version with patch (a.b.c):
236264

237265
$ swiftly uninstall 5.2.1
238266

239267
Or a full snapshot name with date (a.b-snapshot-YYYY-mm-dd):
240268

241269
$ swiftly uninstall 5.7-snapshot-2022-06-20
242270

271+
Multiple toolchain selectors can uninstall multiple toolchains at once:
272+
273+
$ swiftly uninstall 5.2.1 6.0.1
274+
243275
Less specific selectors can be used to uninstall multiple toolchains at once. For instance, the patch version can be omitted to uninstall all toolchains associated with a given minor version release:
244276

245277
$ swiftly uninstall 5.6
@@ -285,7 +317,7 @@ Finally, all installed toolchains can be uninstalled by specifying 'all':
285317
List installed toolchains.
286318

287319
```
288-
swiftly list [<toolchain-selector>] [--version] [--help]
320+
swiftly list [<toolchain-selector>] [--format=<format>] [--version] [--help]
289321
```
290322

291323
**toolchain-selector:**
@@ -311,6 +343,11 @@ The installed snapshots for a given development branch can be listed by specifyi
311343
$ swiftly list 5.7-snapshot
312344

313345

346+
**--format=\<format\>:**
347+
348+
*Output format (text, json)*
349+
350+
314351
**--version:**
315352

316353
*Show the version.*
@@ -464,7 +501,7 @@ swiftly init [--no-modify-profile] [--overwrite] [--platform=<platform>] [--skip
464501
Update the version of swiftly itself.
465502

466503
```
467-
swiftly self-update [--assume-yes] [--verbose] [--version] [--help]
504+
swiftly self-update [--assume-yes] [--verbose] [--version] [--help]
468505
```
469506

470507
**--assume-yes:**

0 commit comments

Comments
 (0)