Skip to content

Commit 596dd32

Browse files
committed
Fix swiftly install
1 parent 3308a6d commit 596dd32

File tree

1 file changed

+33
-58
lines changed

1 file changed

+33
-58
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -33,54 +33,12 @@ jobs:
3333
EMULATOR_ARCH: 'x86_64'
3434
EMULATOR_GPU: 'swiftshader_indirect'
3535

36-
- name: 'macOS 13 API 28'
37-
os: 'macos-13'
38-
ANDROID_API: 28
39-
EMULATOR_ARCH: 'x86_64'
40-
EMULATOR_GPU: 'swiftshader_indirect'
41-
4236
- name: 'Ubuntu Latest API 28'
4337
os: 'ubuntu-latest'
4438
ANDROID_API: 28
4539
EMULATOR_ARCH: 'x86_64'
4640
EMULATOR_GPU: 'swiftshader_indirect'
4741

48-
- name: 'Ubuntu Latest API 29'
49-
os: 'ubuntu-latest'
50-
ANDROID_API: 29
51-
EMULATOR_ARCH: 'x86_64'
52-
EMULATOR_GPU: 'swiftshader_indirect'
53-
54-
- name: 'Ubuntu Latest API 30'
55-
os: 'ubuntu-latest'
56-
ANDROID_API: 30
57-
EMULATOR_ARCH: 'x86_64'
58-
EMULATOR_GPU: 'swiftshader_indirect'
59-
60-
- name: 'Ubuntu Latest API 31'
61-
os: 'ubuntu-latest'
62-
ANDROID_API: 31
63-
EMULATOR_ARCH: 'x86_64'
64-
EMULATOR_GPU: 'swiftshader_indirect'
65-
66-
- name: 'Ubuntu Latest API 32'
67-
os: 'ubuntu-latest'
68-
ANDROID_API: 32
69-
EMULATOR_ARCH: 'x86_64'
70-
EMULATOR_GPU: 'swiftshader_indirect'
71-
72-
- name: 'Ubuntu Latest API 33'
73-
os: 'ubuntu-latest'
74-
ANDROID_API: 33
75-
EMULATOR_ARCH: 'x86_64'
76-
EMULATOR_GPU: 'swiftshader_indirect'
77-
78-
- name: 'Ubuntu Latest API 34'
79-
os: 'ubuntu-latest'
80-
ANDROID_API: 34
81-
EMULATOR_ARCH: 'x86_64'
82-
EMULATOR_GPU: 'swiftshader_indirect'
83-
8442
- name: 'Ubuntu Latest API 35'
8543
os: 'ubuntu-latest'
8644
ANDROID_API: 35
@@ -102,21 +60,6 @@ jobs:
10260
ANDROID_CHANNEL: "3"
10361
BUILD_TOOLS_VERSION: "35.0.0"
10462
steps:
105-
- name: Free Disk Space
106-
if: runner.os == 'Linux'
107-
run: |
108-
sudo rm -rf /usr/share/dotnet
109-
sudo rm -rf /opt/ghc
110-
sudo rm -rf "/usr/local/share/boost"
111-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
112-
113-
- name: Enable KVM
114-
if: runner.os == 'Linux'
115-
run: |
116-
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
117-
sudo udevadm control --reload-rules
118-
sudo udevadm trigger --name-match=kvm
119-
12063
- uses: nttld/setup-ndk@v1
12164
id: setup-ndk
12265
with:
@@ -132,8 +75,25 @@ jobs:
13275
echo "ANDROID_AVD_HOME=${XDG_CONFIG_HOME}/.android/avd" >> $GITHUB_ENV
13376
fi
13477
78+
# swiftly install instructions from https://www.swift.org/install/linux/
13579
- name: "Install Swiftly"
136-
run: curl -L https://swiftlang.github.io/swiftly/swiftly-install.sh | bash -s -- -y
80+
run: |
81+
if [[ "${RUNNER_OS}" == "macOS" ]]; then
82+
curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \
83+
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \
84+
~/.swiftly/bin/swiftly init --quiet-shell-followup && \
85+
. "${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh" && \
86+
hash -r
87+
elif [[ "${RUNNER_OS}" == "Linux" ]]; then
88+
curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \
89+
tar zxf swiftly-$(uname -m).tar.gz && \
90+
./swiftly init --quiet-shell-followup && \
91+
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh" && \
92+
hash -r
93+
else
94+
echo "Error: unsupported OS: ${RUNNER_OS}"
95+
exit 1
96+
fi
13797
13898
- name: "Install Swift SDK for Android"
13999
run: swift sdk install https://download.swift.org/development/android-sdk/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a_android-0.1.artifactbundle.tar.gz --checksum 451844c232cf1fa02c52431084ed3dc27a42d103635c6fa71bae8d66adba2500
@@ -150,6 +110,21 @@ jobs:
150110
swiftly run swift package init --type executable
151111
swiftly run swift build --swift-sdk x86_64-unknown-linux-android${ANDROID_API} --static-swift-stdlib
152112
113+
- name: Free Disk Space
114+
if: runner.os == 'Linux'
115+
run: |
116+
sudo rm -rf /usr/share/dotnet
117+
sudo rm -rf /opt/ghc
118+
sudo rm -rf "/usr/local/share/boost"
119+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
120+
121+
- name: Enable KVM
122+
if: runner.os == 'Linux'
123+
run: |
124+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
125+
sudo udevadm control --reload-rules
126+
sudo udevadm trigger --name-match=kvm
127+
153128
- name: Android SDKs - setup environment
154129
run: yes y | sdkmanager --licenses
155130

0 commit comments

Comments
 (0)