Skip to content

Commit 38212d9

Browse files
authored
Merge branch 'swift-android-sdk:main' into main
2 parents 08d2fbc + 7932b35 commit 38212d9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.github/workflows/android_sdk.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
fi
3939
4040
# Generate matrix with parsed environment variables
41+
# FIXME: move script back from swift-android-sdk repo to swift-nio
4142
cat >> "$GITHUB_OUTPUT" << EOM
4243
android-sdk-matrix=$(echo '{
4344
"config":[
@@ -47,7 +48,7 @@ jobs:
4748
"platform":"Linux",
4849
"runner":"ubuntu-latest",
4950
"image":"ubuntu:jammy",
50-
"setup_command":"apt update -q && apt install -y -q curl jq tar && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_prerequisites.sh | bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_sdk.sh | INSTALL_SWIFT_BRANCH=main INSTALL_SWIFT_ARCH=x86_64 INSTALL_SWIFT_SDK=android-sdk bash && hash -r",
51+
"setup_command":"apt update -q && apt install -y -q curl jq tar && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_prerequisites.sh | bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-android-sdk/main/scripts/install_swift_sdk.sh | INSTALL_SWIFT_BRANCH=main INSTALL_SWIFT_ARCH=x86_64 INSTALL_SWIFT_SDK=android-sdk bash && hash -r",
5152
"command":"curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/swift-build-with-android-sdk.sh | bash -s --",
5253
"command_arguments":"${{ inputs.additional_command_arguments }}",
5354
"env":'"$env_vars_json"'

scripts/install_swift_sdk.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,15 @@ swift sdk install "$sdk_path"
131131
if [[ "$sdk" == "android-sdk" ]]; then
132132
log "Swift SDK Post-install"
133133
# guess some common places where the swift-sdks file lives
134-
cd ~/Library/org.swift.swiftpm || cd ~/.config/swiftpm || cd ~/.local/swiftpm || cd ~/.swiftpm || cd /root/.swiftpm
134+
cd ~/Library/org.swift.swiftpm || cd ~/.config/swiftpm || cd ~/.local/swiftpm || cd ~/.swiftpm || cd /root/.swiftpm || exit 1
135135

136136
# download and link the NDK
137-
local android_ndk_version="r27d"
137+
android_ndk_version="r27d"
138138
curl -fsSL -o ndk.zip --retry 3 "https://dl.google.com/android/repository/android-ndk-${android_ndk_version}-$(uname -s).zip"
139139
unzip -q ndk.zip
140140
rm ndk.zip
141141
export ANDROID_NDK_HOME="${PWD}/android-ndk-${android_ndk_version}"
142-
./swift-sdks/*android*.artifactbundle/swift-android/scripts/setup-android-sdk.sh
143-
cd -
142+
bundledir=$(ls -d swift-sdks/*android*.artifactbundle | head -n 1)
143+
${bundledir}/swift-android/scripts/setup-android-sdk.sh
144+
cd - || exit
144145
fi

0 commit comments

Comments
 (0)