@@ -303,23 +303,26 @@ runs:
303
303
SWIFT_SDK_ID="${{ steps.setup.outputs.swift-id }}"
304
304
# TODO: identify the version automatically
305
305
SWIFT_SDK_VERSION="0.1"
306
+ SWIFT_SDK_ARCH="${{ steps.setup.outputs.android-sdk-arch }}"
306
307
307
- if [[ "${SWIFT_SDK_ID}" =~ "6.0" || "${SWIFT_SDK_ID}" =~ "6.1" ]]; then
308
+ if [[ "${SWIFT_SDK_ID}" =~ "- 6.0" || "${SWIFT_SDK_ID}" =~ "- 6.1" ]]; then
308
309
# Swift Android SDK 6.0/6.1 targets API 24+
309
310
SWIFT_SDK_ANROID_API="24"
310
311
SWIFT_SDK_ID="${SWIFT_SDK_ID}-android-${SWIFT_SDK_ANROID_API}-${SWIFT_SDK_VERSION}"
312
+ # resourcePath in info.json in SDK 6.0/6.1 does not contain arch
313
+ SWIFT_SDK_ARCH_RESOURCE_PATTERN=""
311
314
else
312
315
# Swift Android SDK 6.2+ targets API 28+
313
316
SWIFT_SDK_ANROID_API="28"
314
317
# 6.2+ no longer includes the API in the artifactbundle name
315
318
SWIFT_SDK_ID="${SWIFT_SDK_ID}-android-${SWIFT_SDK_VERSION}"
319
+ SWIFT_SDK_ARCH_RESOURCE_PATTERN="${SWIFT_SDK_ARCH}"
316
320
fi
317
321
ANDROID_SDK_URL="https://github.com/skiptools/swift-android-toolchain/releases/download/${{ steps.setup.outputs.swift-version }}/${SWIFT_SDK_ID}.artifactbundle.tar.gz"
318
322
319
323
echo "ANDROID_SDK_URL: ${ANDROID_SDK_URL}"
320
324
curl -fsSL --retry 8 --retry-connrefused ${ANDROID_SDK_URL} --output ${SWIFT_SDK_ID}.artifactbundle.tar.gz
321
325
322
- SWIFT_SDK_ARCH="${{ steps.setup.outputs.android-sdk-arch }}"
323
326
SWIFT_SDK_TARGET="${SWIFT_SDK_ARCH}-unknown-linux-android${SWIFT_SDK_ANROID_API}"
324
327
echo "SWIFT_SDK_TARGET=${SWIFT_SDK_TARGET}" >> $GITHUB_ENV
325
328
@@ -343,8 +346,8 @@ runs:
343
346
344
347
# extract the swiftResourcesPath from the swift-sdk.json
345
348
# note that we need to use the right path for the architecure;
346
- # we use a crude grep pattern for SWIFT_SDK_ARCH
347
- SWIFT_RESOURCES_ROOT_PATH=$(cat ${SWIFT_ARTIFACTBUNDLE_ROOT}/swift-sdk.json | jq -r '.targetTriples[] | .swiftResourcesPath' | grep "${SWIFT_SDK_ARCH }" | head -n 1)
349
+ # we use a crude grep pattern for SWIFT_SDK_ARCH_RESOURCE_PATTERN
350
+ SWIFT_RESOURCES_ROOT_PATH=$(cat ${SWIFT_ARTIFACTBUNDLE_ROOT}/swift-sdk.json | jq -r '.targetTriples[] | .swiftResourcesPath' | grep "${SWIFT_SDK_ARCH_RESOURCE_PATTERN }" | head -n 1)
348
351
SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH="${SWIFT_ARTIFACTBUNDLE_ROOT}/${SWIFT_RESOURCES_ROOT_PATH}"
349
352
350
353
echo "SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH=${SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH}" >> $GITHUB_ENV
0 commit comments