From 2ba4036ed761b66f04c991d4a88e87999bd11fe3 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Fri, 4 Nov 2022 17:39:06 +0100 Subject: [PATCH] Add pre-built ppc64le and aarch64 linux binaries --- .github/workflows/deploy.yml | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f4d09b16..7606c5bf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -59,33 +59,51 @@ jobs: path: cargo-c-windows-${{ matrix.conf }}.zip linux-binaries: + strategy: + matrix: + target: + - x86_64-unknown-linux-musl + - powerpc64le-unknown-linux-gnu + - aarch64-unknown-linux-gnu + include: + - target: x86_64-unknown-linux-musl + sdk: musl-tools + cc: musl-gcc + - target: powerpc64le-unknown-linux-gnu + sdk: crossbuild-essential-ppc64el + cc: powerpc64le-linux-gnu-gcc + - target: aarch64-unknown-linux-gnu + sdk: crossbuild-essential-arm64 + cc: aarch64-linux-gnu-gcc runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install musl-tools + - name: Install $${{ matrix.sdk }} run: | - sudo apt-get install musl-tools + sudo apt-get install ${{ matrix.sdk }} - - name: Install Rust stable and musl target + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: profile: minimal toolchain: stable - target: x86_64-unknown-linux-musl + target: ${{ matrix.target }} override: true - name: Build cargo-c run: | - cargo build --target x86_64-unknown-linux-musl --release --features vendored-openssl + mkdir .cargo + echo -e "[target.${{ matrix.target }}]\nlinker=\"${{ matrix.cc }}\"" > .cargo/config + cargo build --target ${{ matrix.target }} --release --features vendored-openssl - name: Create zip run: | - cd target/x86_64-unknown-linux-musl/release + cd target/${{ matrix.target }}/release strip cargo-capi cargo-cbuild cargo-cinstall - tar -czvf $GITHUB_WORKSPACE/cargo-c-linux.tar.gz \ + tar -czvf $GITHUB_WORKSPACE/cargo-c-${{ matrix.target }}.tar.gz \ cargo-capi \ cargo-cbuild \ cargo-cinstall @@ -93,8 +111,8 @@ jobs: - name: Upload binaries uses: actions/upload-artifact@v2 with: - name: cargo-c-linux-binaries - path: cargo-c-linux.tar.gz + name: cargo-c-${{ matrix.target }}-binaries + path: cargo-c-${{ matrix.target }}.tar.gz macos-binaries: