Skip to content

Commit d0209ca

Browse files
committed
Check architecture for the resource path folder to copy shared libraries
1 parent 73c60ba commit d0209ca

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,23 +303,26 @@ runs:
303303
SWIFT_SDK_ID="${{ steps.setup.outputs.swift-id }}"
304304
# TODO: identify the version automatically
305305
SWIFT_SDK_VERSION="0.1"
306+
SWIFT_SDK_ARCH="${{ steps.setup.outputs.android-sdk-arch }}"
306307
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
308309
# Swift Android SDK 6.0/6.1 targets API 24+
309310
SWIFT_SDK_ANROID_API="24"
310311
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=""
311314
else
312315
# Swift Android SDK 6.2+ targets API 28+
313316
SWIFT_SDK_ANROID_API="28"
314317
# 6.2+ no longer includes the API in the artifactbundle name
315318
SWIFT_SDK_ID="${SWIFT_SDK_ID}-android-${SWIFT_SDK_VERSION}"
319+
SWIFT_SDK_ARCH_RESOURCE_PATTERN="${SWIFT_SDK_ARCH}"
316320
fi
317321
ANDROID_SDK_URL="https://github.com/skiptools/swift-android-toolchain/releases/download/${{ steps.setup.outputs.swift-version }}/${SWIFT_SDK_ID}.artifactbundle.tar.gz"
318322
319323
echo "ANDROID_SDK_URL: ${ANDROID_SDK_URL}"
320324
curl -fsSL --retry 8 --retry-connrefused ${ANDROID_SDK_URL} --output ${SWIFT_SDK_ID}.artifactbundle.tar.gz
321325
322-
SWIFT_SDK_ARCH="${{ steps.setup.outputs.android-sdk-arch }}"
323326
SWIFT_SDK_TARGET="${SWIFT_SDK_ARCH}-unknown-linux-android${SWIFT_SDK_ANROID_API}"
324327
echo "SWIFT_SDK_TARGET=${SWIFT_SDK_TARGET}" >> $GITHUB_ENV
325328
@@ -343,8 +346,8 @@ runs:
343346
344347
# extract the swiftResourcesPath from the swift-sdk.json
345348
# 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)
348351
SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH="${SWIFT_ARTIFACTBUNDLE_ROOT}/${SWIFT_RESOURCES_ROOT_PATH}"
349352
350353
echo "SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH=${SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)