Skip to content

Commit 4cb3604

Browse files
committed
Fix Android NDK setup: locate SDK dir dynamically instead of hardcoding path
The doc-recommended ~/.swiftpm/swift-sdks/... path didn't match where swift sdk install placed the bundle inside the swift:6.3.2 container (actual HOME differed from what the docs assume). Locate the swift-android directory with find instead of hardcoding the path.
1 parent 85719e3 commit 4cb3604

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎.github/workflows/swift.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ jobs:
8383
run: |
8484
set -eux
8585
unset ANDROID_NDK_ROOT
86-
cd ~/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_android.artifactbundle/swift-android/
86+
sdk_dir="$(find / -maxdepth 8 -type d -path '*swift-6.3.2-RELEASE_android.artifactbundle/swift-android' 2>/dev/null | head -1)"
87+
test -n "$sdk_dir"
88+
cd "$sdk_dir"
8789
curl -fSL -o ndk.zip "https://dl.google.com/android/repository/android-ndk-r27d-Linux.zip"
8890
unzip -qo ndk.zip
8991
echo "ANDROID_NDK_HOME=$PWD/android-ndk-r27d" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)