From c7e1bd1cdbc8b3519c5094ab36ea1e28396396d1 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Fri, 9 Aug 2024 17:29:02 +0200 Subject: [PATCH] feat: Download correct musl toolchain --- .github/workflows/early-access.yml | 21 ++++++++++++++++++--- .github/workflows/release.yml | 21 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/early-access.yml b/.github/workflows/early-access.yml index 25ba882..e09211e 100644 --- a/.github/workflows/early-access.yml +++ b/.github/workflows/early-access.yml @@ -58,14 +58,27 @@ jobs: run: | TMP_DIR=$(mktemp -d) pushd $TMP_DIR - curl -LOJ http://more.musl.cc/10/x86_64-linux-musl/x86_64-linux-musl-native.tgz - tar -xvf x86_64-linux-musl-native.tgz + case $MATRIX_OS in + ubuntu-latest) + curl -LOJ https://musl.cc/x86_64-linux-musl-native.tgz + tar -xvf x86_64-linux-musl-native.tgz + TOOLCHAIN_DIR=$TMP_DIR/x86_64-linux-musl-native + ;; + linux-arm64) + curl -LOJ https://musl.cc/aarch64-linux-musl-native.tgz + tar -xvf aarch64-linux-musl-native.tgz + TOOLCHAIN_DIR=$TMP_DIR/aarch64-linux-musl-native + ;; + *) + echo 'Unexpected CPU architecture! + exit 1 + ;; + esac curl -LOJ https://zlib.net/fossils/zlib-1.3.tar.gz tar -xzf zlib-1.3.tar.gz cd zlib-1.3 - TOOLCHAIN_DIR=$TMP_DIR/x86_64-linux-musl-native CC=$TOOLCHAIN_DIR/bin/gcc ./configure --prefix=$TOOLCHAIN_DIR --static @@ -74,6 +87,8 @@ jobs: echo "TOOLCHAIN_DIR=$TOOLCHAIN_DIR" >> $GITHUB_OUTPUT if: matrix.os == 'ubuntu-latest' || matrix.os == 'linux-arm64' + env: + MATRIX_OS: ${{ matrix.os }} - name: Cache Maven packages id: restore-maven-package-cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76be447..5eaf489 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,14 +117,27 @@ jobs: run: | TMP_DIR=$(mktemp -d) pushd $TMP_DIR - curl -LOJ http://more.musl.cc/10/x86_64-linux-musl/x86_64-linux-musl-native.tgz - tar -xvf x86_64-linux-musl-native.tgz + case $MATRIX_OS in + ubuntu-latest) + curl -LOJ https://musl.cc/x86_64-linux-musl-native.tgz + tar -xvf x86_64-linux-musl-native.tgz + TOOLCHAIN_DIR=$TMP_DIR/x86_64-linux-musl-native + ;; + linux-arm64) + curl -LOJ https://musl.cc/aarch64-linux-musl-native.tgz + tar -xvf aarch64-linux-musl-native.tgz + TOOLCHAIN_DIR=$TMP_DIR/aarch64-linux-musl-native + ;; + *) + echo 'Unexpected CPU architecture! + exit 1 + ;; + esac curl -LOJ https://zlib.net/fossils/zlib-1.3.tar.gz tar -xzf zlib-1.3.tar.gz cd zlib-1.3 - TOOLCHAIN_DIR=$TMP_DIR/x86_64-linux-musl-native CC=$TOOLCHAIN_DIR/bin/gcc ./configure --prefix=$TOOLCHAIN_DIR --static @@ -133,6 +146,8 @@ jobs: echo "TOOLCHAIN_DIR=$TOOLCHAIN_DIR" >> $GITHUB_OUTPUT if: matrix.os == 'ubuntu-latest' || matrix.os == 'linux-arm64' + env: + MATRIX_OS: ${{ matrix.os }} - name: Cache Maven packages uses: actions/cache@v4.0.2