Skip to content

Commit 74bdd6d

Browse files
committed
Check architecture for the resource path folder to copy shared libraries
1 parent 026287c commit 74bdd6d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

action.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,15 @@ runs:
312312
# Swift Android SDK 6.2+ targets API 28+
313313
SWIFT_SDK_ANROID_API="28"
314314
# 6.2+ no longer includes the API in the artifactbundle name
315-
# it also uses an underscore instead of a dash before "android"
316-
SWIFT_SDK_ID="${SWIFT_SDK_ID}_android-${SWIFT_SDK_VERSION}"
315+
SWIFT_SDK_ID="${SWIFT_SDK_ID}-android-${SWIFT_SDK_VERSION}"
317316
fi
318317
ANDROID_SDK_URL="https://github.com/skiptools/swift-android-toolchain/releases/download/${{ steps.setup.outputs.swift-version }}/${SWIFT_SDK_ID}.artifactbundle.tar.gz"
319318
320319
echo "ANDROID_SDK_URL: ${ANDROID_SDK_URL}"
321320
curl -fsSL --retry 8 --retry-connrefused ${ANDROID_SDK_URL} --output ${SWIFT_SDK_ID}.artifactbundle.tar.gz
322321
323-
SWIFT_SDK_TARGET="${{ steps.setup.outputs.android-sdk-arch }}-unknown-linux-android${SWIFT_SDK_ANROID_API}"
322+
SWIFT_SDK_ARCH=${{ steps.setup.outputs.android-sdk-arch }}"
323+
SWIFT_SDK_TARGET="${SWIFT_SDK_ARCH}-unknown-linux-android${SWIFT_SDK_ANROID_API}"
324324
echo "SWIFT_SDK_TARGET=${SWIFT_SDK_TARGET}" >> $GITHUB_ENV
325325
326326
# first check if it already installed (we may be running this workflow multiple times for an action, in which case it will already be present)
@@ -342,7 +342,9 @@ runs:
342342
echo "SWIFT_ARTIFACTBUNDLE_SDK_ROOT_PATH=${SWIFT_ARTIFACTBUNDLE_SDK_ROOT_PATH}" >> $GITHUB_ENV
343343
344344
# extract the swiftResourcesPath from the swift-sdk.json
345-
SWIFT_RESOURCES_ROOT_PATH=$(cat ${SWIFT_ARTIFACTBUNDLE_ROOT}/swift-sdk.json | jq -r '.targetTriples[] | .swiftResourcesPath' | head -n 1)
345+
# 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)
346348
SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH="${SWIFT_ARTIFACTBUNDLE_ROOT}/${SWIFT_RESOURCES_ROOT_PATH}"
347349
348350
echo "SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH=${SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)