Swift 6.0 #169
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Android Toolchain | |
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the master branch | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-swift-android-arm-64: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
- name: Clone scripts | |
uses: actions/checkout@v1 | |
- name: Install NDK | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
run: ./build/Linux/003-define-build-folders.sh | |
- name: Clone Swift | |
run: ./build/Linux/020-clone-swift.sh | |
- name: Cache Swift Arm64 | |
id: cache-swift-arm-64 | |
uses: actions/cache@v2 | |
with: | |
path: ~/out/swift-android/lib | |
key: ${{ runner.os }}-stdlib-arm64-${{ hashFiles('.swift.sum') }} | |
- name: Build Swift | |
if: steps.cache-swift-arm-64.outputs.cache-hit != 'true' | |
run: ./build/Linux/031-build-swift-arm64.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android-arm64-v8a | |
path: ~/out/swift-android/lib | |
build-swift-android-armeabi-v7a: | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
run: ./build/Linux/003-define-build-folders.sh | |
- name: Clone Swift | |
run: ./build/Linux/020-clone-swift.sh | |
- name: Cache Swift Arm 32 | |
id: cache-swift-arm-32 | |
uses: actions/cache@v2 | |
with: | |
path: ~/out/swift-android/lib | |
key: ${{ runner.os }}-stdlib-arm32-${{ hashFiles('.swift.sum') }} | |
- name: Build Swift | |
if: steps.cache-swift-arm-32.outputs.cache-hit != 'true' | |
run: ./build/Linux/032-build-swift-arm.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android-armeabi-v7a | |
path: ~/out/swift-android/lib | |
build-swift-android-x86_64: | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
run: ./build/Linux/003-define-build-folders.sh | |
- name: Clone Swift | |
run: ./build/Linux/020-clone-swift.sh | |
- name: Cache Swift x86_64 | |
id: cache-swift-x86_64 | |
uses: actions/cache@v2 | |
with: | |
path: ~/out/swift-android/lib | |
key: ${{ runner.os }}-stdlib-x86_64-${{ hashFiles('.swift.sum') }} | |
- name: Build Swift | |
if: steps.cache-swift-x86_64.outputs.cache-hit != 'true' | |
run: ./build/Linux/033-build-swift-x86_64.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android-x86_64 | |
path: ~/out/swift-android/lib | |
build-icu-android: | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Cache ICU | |
id: cache-icu | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/icu/build-aarch64-linux-android/lib | |
~/icu/build-armv7a-linux-androideabi/lib | |
~/icu/build-x86_64-linux-android/lib | |
~/icu/build-i686-linux-android/lib | |
key: icu-73-2-r5 | |
- name: Install dependencies | |
if: steps.cache-icu.outputs.cache-hit != 'true' | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
if: steps.cache-icu.outputs.cache-hit != 'true' | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
if: steps.cache-icu.outputs.cache-hit != 'true' | |
run: ./build/Linux/003-define-build-folders.sh | |
- name: Build ICU | |
if: steps.cache-icu.outputs.cache-hit != 'true' | |
run: ./build/Linux/040-build-icu.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: icu-arm64-v8a | |
path: ~/icu/build-aarch64-linux-android/lib | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: icu-armeabi-v7a | |
path: ~/icu/build-armv7a-linux-androideabi/lib | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: icu-x86_64 | |
path: ~/icu/build-x86_64-linux-android/lib | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: icu-x86 | |
path: ~/icu/build-i686-linux-android/lib | |
build-openssl-android: | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Cache OpenSSL | |
id: cache-openssl | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/openssl/arm64 | |
~/openssl/arm | |
~/openssl/x86_64 | |
~/openssl/x86 | |
key: openssl-1.1.1w-r4 | |
- name: Install dependencies | |
if: steps.cache-openssl.outputs.cache-hit != 'true' | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
if: steps.cache-openssl.outputs.cache-hit != 'true' | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
if: steps.cache-openssl.outputs.cache-hit != 'true' | |
run: ./build/Linux/003-define-build-folders.sh | |
- name: Build OpenSSL | |
if: steps.cache-openssl.outputs.cache-hit != 'true' | |
run: ./build/Linux/041-build-openssl.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl-arm64-v8a | |
path: ~/openssl/arm64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl-armeabi-v7a | |
path: ~/openssl/arm | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl-x86_64 | |
path: ~/openssl/x86_64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl-x86 | |
path: ~/openssl/x86 | |
build-curl-android: | |
needs: [build-openssl-android] | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Cache curl | |
id: cache-curl | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/curl/arm64 | |
~/curl/arm | |
~/curl/x86_64 | |
~/curl/x86 | |
key: curl-7_88_1-r10 | |
- name: Install dependencies | |
if: steps.cache-curl.outputs.cache-hit != 'true' | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
if: steps.cache-curl.outputs.cache-hit != 'true' | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
if: steps.cache-curl.outputs.cache-hit != 'true' | |
run: ./build/Linux/003-define-build-folders.sh | |
- uses: actions/download-artifact@v4 | |
if: steps.cache-curl.outputs.cache-hit != 'true' | |
with: | |
name: openssl-arm64-v8a | |
path: ~/openssl/arm64 | |
- uses: actions/download-artifact@v4 | |
if: steps.cache-curl.outputs.cache-hit != 'true' | |
with: | |
name: openssl-armeabi-v7a | |
path: ~/openssl/arm | |
- uses: actions/download-artifact@v4 | |
if: steps.cache-curl.outputs.cache-hit != 'true' | |
with: | |
name: openssl-x86 | |
path: ~/openssl/x86 | |
- uses: actions/download-artifact@v4 | |
if: steps.cache-curl.outputs.cache-hit != 'true' | |
with: | |
name: openssl-x86_64 | |
path: ~/openssl/x86_64 | |
- name: Build cURL | |
if: steps.cache-curl.outputs.cache-hit != 'true' | |
run: ./build/Linux/042-build-curl.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: curl-arm64-v8a | |
path: ~/curl/arm64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: curl-armeabi-v7a | |
path: ~/curl/arm | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: curl-x86_64 | |
path: ~/curl/x86_64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: curl-x86 | |
path: ~/curl/x86 | |
build-libxml-android: | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Cache libxml | |
id: cache-libxml | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/libxml/arm64 | |
~/libxml/arm | |
~/libxml/x86_64 | |
~/libxml/x86 | |
key: libxmlv2.9.14-r5 | |
- name: Install dependencies | |
if: steps.cache-libxml.outputs.cache-hit != 'true' | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
if: steps.cache-libxml.outputs.cache-hit != 'true' | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
if: steps.cache-libxml.outputs.cache-hit != 'true' | |
run: ./build/Linux/003-define-build-folders.sh | |
- name: Build libXML | |
if: steps.cache-libxml.outputs.cache-hit != 'true' | |
run: ./build/Linux/043-build-libxml.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libxml-arm64-v8a | |
path: ~/libxml/arm64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libxml-armeabi-v7a | |
path: ~/libxml/arm | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libxml-x86_64 | |
path: ~/libxml/x86_64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libxml-x86 | |
path: ~/libxml/x86 | |
build-swift-corelibs-android-arm-64: | |
needs: [build-icu-android, build-openssl-android, build-curl-android, build-libxml-android, build-swift-android-arm-64] | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
run: ./build/Linux/003-define-build-folders.sh | |
- uses: actions/download-artifact@v4 | |
with: | |
name: icu-arm64-v8a | |
path: ~/icu/build-aarch64-linux-android | |
- uses: actions/download-artifact@v4 | |
with: | |
name: openssl-arm64-v8a | |
path: ~/openssl/arm64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: curl-arm64-v8a | |
path: ~/curl/arm64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: libxml-arm64-v8a | |
path: ~/libxml/arm64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swift-android-arm64-v8a | |
path: ~/swift-android/lib | |
- name: Replace toolchain lib | |
run: rm -rf ~/swift-toolchain/usr/lib; mv ~/swift-android/lib ~/swift-toolchain/usr/lib | |
- name: Clone Swift | |
run: ./build/Linux/020-clone-swift.sh | |
- name: Build Corelibs | |
run: ./build/Linux/052-build-corelibs.sh arm64 aarch64 aarch64-linux-android arm64-v8a aarch64-linux-android | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android-clang-libs | |
path: ~/out/swift-android/swift-nightly-install/usr/lib/clang | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android-arm64-v8a-libs | |
path: ~/out/swift-android/swift-nightly-install/usr/lib/swift-aarch64 | |
build-swift-corelibs-android-armeabi-v7a: | |
needs: [build-icu-android, build-openssl-android, build-curl-android, build-libxml-android, build-swift-android-armeabi-v7a] | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
run: ./build/Linux/003-define-build-folders.sh | |
- uses: actions/download-artifact@v4 | |
with: | |
name: icu-armeabi-v7a | |
path: ~/icu/build-armv7a-linux-androideabi | |
- uses: actions/download-artifact@v4 | |
with: | |
name: openssl-armeabi-v7a | |
path: ~/openssl/arm | |
- uses: actions/download-artifact@v4 | |
with: | |
name: curl-armeabi-v7a | |
path: ~/curl/arm | |
- uses: actions/download-artifact@v4 | |
with: | |
name: libxml-armeabi-v7a | |
path: ~/libxml/arm | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swift-android-armeabi-v7a | |
path: ~/swift-android/lib | |
- name: Replace toolchain lib | |
run: rm -rf ~/swift-toolchain/usr/lib; mv ~/swift-android/lib ~/swift-toolchain/usr/lib | |
- name: Clone Swift | |
run: ./build/Linux/020-clone-swift.sh | |
- name: Build Corelibs | |
run: ./build/Linux/052-build-corelibs.sh arm armv7 arm-linux-androideabi armeabi-v7a armv7a-linux-androideabi | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android-armeabi-v7a-libs | |
path: ~/out/swift-android/swift-nightly-install/usr/lib/swift-armv7 | |
build-swift-corelibs-android-x86_64: | |
needs: [build-icu-android, build-openssl-android, build-curl-android, build-libxml-android, build-swift-android-x86_64] | |
runs-on: ubuntu-20.04 | |
container: ubuntu:focal | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: ./build/Linux/000-install-dependencies.sh | |
- name: Install NDK | |
run: ./build/Linux/002-install-ndk.sh | |
- name: Define build folders | |
run: ./build/Linux/003-define-build-folders.sh | |
- uses: actions/download-artifact@v4 | |
with: | |
name: icu-x86_64 | |
path: ~/icu/build-x86_64-linux-android | |
- uses: actions/download-artifact@v4 | |
with: | |
name: openssl-x86_64 | |
path: ~/openssl/x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: curl-x86_64 | |
path: ~/curl/x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: libxml-x86_64 | |
path: ~/libxml/x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swift-android-x86_64 | |
path: ~/swift-android/lib | |
- name: Replace toolchain lib | |
run: rm -rf ~/swift-toolchain/usr/lib; mv ~/swift-android/lib ~/swift-toolchain/usr/lib | |
- name: Clone Swift | |
run: ./build/Linux/020-clone-swift.sh | |
- name: Build Corelibs | |
run: ./build/Linux/052-build-corelibs.sh x86_64 x86_64 x86_64-linux-android x86_64 x86_64-linux-android | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android-x86_64-libs | |
path: ~/out/swift-android/swift-nightly-install/usr/lib/swift-x86_64 | |
build-swift-mac-x86_64: | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: ./build/macOS/000-install-dependencies.sh | |
- name: Clone Swift | |
run: ./build/macOS/010-clone-swift.sh | |
- name: Cache Swift Mac | |
id: cache-swift-mac | |
uses: actions/cache@v2 | |
with: | |
path: ~/swift-android-bin.tar | |
key: ${{ runner.os }}-x86_64-${{ hashFiles('.swift.sum') }} | |
- name: Build Swift | |
if: steps.cache-swift-mac.outputs.cache-hit != 'true' | |
run: ./build/macOS/020-build-swift.sh | |
- name: Build Swift PM | |
if: steps.cache-swift-mac.outputs.cache-hit != 'true' | |
run: ./build/macOS/030-build-swiftpm.sh | |
- name: Collect toolchain bin | |
if: steps.cache-swift-mac.outputs.cache-hit != 'true' | |
run: ./build/macOS/040-collect-toolchain-bin.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android-bin | |
path: ~/swift-android-bin.tar | |
collect-mac-x86_64-toolchain: | |
needs: [build-swift-mac-x86_64, build-swift-corelibs-android-arm-64, build-swift-corelibs-android-armeabi-v7a, build-swift-corelibs-android-x86_64] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install NDK | |
run: ./build/Linux/002-install-ndk.sh | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swift-android-bin | |
path: ~/ | |
- name: Unarchive bin | |
run: cd ~/; tar -xvf swift-android-bin.tar | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swift-android-arm64-v8a-libs | |
path: ~/lib/swift-aarch64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swift-android-armeabi-v7a-libs | |
path: ~/lib/swift-armv7 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swift-android-x86_64-libs | |
path: ~/lib/swift-x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: swift-android-clang-libs | |
path: ~/lib/clang | |
- name: Collect toolchain | |
run: ./build/Linux/060-collect-toolchain.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: swift-android | |
path: ~/out/swift-android.zip |