@@ -139,13 +139,13 @@ on:
139139 type : string
140140 description : " Command to use when building the package with the Swift SDK for Android"
141141 default : " swift build"
142- android_sdk_triple :
142+ android_sdk_triples :
143143 type : string
144- description : " The triple to use when building with the Swift SDK for Android"
145- default : " [\" x86_64-unknown-linux-android28\" ]"
146- android_ndk_version :
144+ description : " The triples to use when building with the Swift SDK for Android"
145+ default : " [\" aarch64-unknown-linux-android28 \" , \" x86_64-unknown-linux-android28\" ]"
146+ android_ndk_versions :
147147 type : string
148- description : " The NDK version to use when building with the Swift SDK for Android"
148+ description : " The NDK versions to use when building with the Swift SDK for Android"
149149 default : " [\" r27d\" ]"
150150 windows_pre_build_command :
151151 type : string
@@ -511,8 +511,7 @@ jobs:
511511 fail-fast : false
512512 matrix :
513513 swift_version : ${{ fromJson(inputs.android_sdk_versions) }}
514- sdk_triple : ${{ fromJson(inputs.android_sdk_triple) }}
515- ndk_version : ${{ fromJson(inputs.android_ndk_version) }}
514+ ndk_version : ${{ fromJson(inputs.android_ndk_versions) }}
516515 os_version : ${{ fromJson(inputs.linux_os_versions) }}
517516 exclude :
518517 - ${{ fromJson(inputs.android_exclude_swift_versions) }}
@@ -529,6 +528,26 @@ jobs:
529528 - name : Checkout repository
530529 uses : actions/checkout@v1
531530 if : ${{ matrix.os_version == 'amazonlinux2' }}
531+ - name : Checkout swiftlang/github-workflows repository
532+ if : ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
533+ uses : actions/checkout@v4
534+ with :
535+ repository : swiftlang/github-workflows
536+ path : github-workflows
537+ - name : Checkout swiftlang/github-workflows repository
538+ if : ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
539+ uses : actions/checkout@v1
540+ with :
541+ repository : swiftlang/github-workflows
542+ path : github-workflows
543+ - name : Determine script-root path
544+ id : script_path
545+ run : |
546+ if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
547+ echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
548+ else
549+ echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
550+ fi
532551 - name : Provide token
533552 if : ${{ inputs.needs_token }}
534553 run : |
@@ -559,8 +578,8 @@ jobs:
559578 echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
560579 exit 1
561580 fi
562- curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main /.github/workflows/scripts/install-and-build-with-sdk.sh | \
563- bash -s -- --android --flags="$BUILD_FLAGS" --build-command="${{ inputs.android_sdk_build_command }}" --android-sdk-triple=" ${{ matrix.sdk_triple }}" --android-ndk-version="${{ matrix.ndk_version }}" ${{ matrix.swift_version }}
581+ cat ${{ steps.script_path.outputs.root }} /.github/workflows/scripts/install-and-build-with-sdk.sh | \
582+ bash -s -- --android --flags="$BUILD_FLAGS" --build-command="${{ inputs.android_sdk_build_command }}" --android-sdk-triple=${{ join(fromJson(inputs.android_sdk_triples), ' --android-sdk-triple=') }} --android-ndk-version="${{ matrix.ndk_version }}" ${{ matrix.swift_version }}
564583
565584 windows-build :
566585 name : Windows (${{ matrix.swift_version }} - windows-2022)
0 commit comments