Skip to content

Commit a333bae

Browse files
committed
CI
1 parent 196e708 commit a333bae

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ jobs:
151151
- name: When Xcode 26 is selected, uninstall and re-install 2026 runtimes
152152
if: ${{ matrix.xcode == '26.0' }}
153153
run: |
154-
sudo xcodes runtimes uninstall 'iOS 26.0' || true
155-
sudo xcodes runtimes uninstall 'tvOS 26.0' || true
156-
sudo xcodes runtimes uninstall 'watchOS 26.0' || true
157-
sudo xcodes runtimes uninstall 'visionOS 26.0' || true
154+
script/remove-runtime iOS 26.0
155+
script/remove-runtime tvOS 26.0
156+
script/remove-runtime watchOS 26.0
157+
script/remove-runtime visionOS 26.0
158158
sudo xcodes runtimes install 'iOS 26.0'
159159
sudo xcodes runtimes install 'tvOS 26.0'
160160
sudo xcodes runtimes install 'watchOS 26.0'

script/remove-runtime

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
dryrun=false
5+
if [[ "${1:-}" == "--dry-run" ]]; then
6+
dryrun=true
7+
shift
8+
fi
9+
10+
platform="${1:-}"
11+
version="${2:-}"
12+
13+
if [[ -z "$platform" || -z "$version" ]]; then
14+
echo "Usage: $0 [--dry-run] <platform> <version>"
15+
echo "Example: $0 --dry-run iOS 17.5"
16+
exit 1
17+
fi
18+
19+
matches=()
20+
21+
while IFS= read -r -d '' runtime; do
22+
name="$(basename "$runtime")"
23+
if [[ "$name" == "$platform $version.simruntime" ]]; then
24+
matches+=("$runtime")
25+
fi
26+
done < <(
27+
find /Library/Developer \
28+
-type d -name "*.simruntime" -prune -print0
29+
)
30+
31+
if [[ ${#matches[@]} -eq 0 ]]; then
32+
echo "No matching runtime found: $platform $version"
33+
exit 1
34+
fi
35+
36+
for runtime in "${matches[@]}"; do
37+
if $dryrun; then
38+
echo "Would remove: $runtime"
39+
else
40+
echo "Removing: $runtime"
41+
sudo rm -rf "$runtime"
42+
fi
43+
done
44+
45+
echo "Processed ${#matches[@]} match(es)."

0 commit comments

Comments
 (0)