From 8561b0d8c0b5af7dfb8631d6f924e5418c92f2ce Mon Sep 17 00:00:00 2001 From: Rajesh Malviya Date: Tue, 5 Dec 2023 07:48:48 +0000 Subject: [PATCH] add linux/aarch64 support. (#326) (#328) Co-authored-by: Daisuke Kato --- .github/workflows/cd.yml | 55 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 429a11e2..6bd284a6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -72,6 +72,53 @@ jobs: path: dist name: dist + # ----- + linux-aarch64: + # Config + name: release - linux-aarch64 + runs-on: ubuntu-latest + env: + TARGET: aarch64-unknown-linux-gnu + ARCHIVE_NAME: wgpu-linux-aarch64 + TOOLCHAIN: stable-aarch64-unknown-linux-gnu + IMAGE: manylinux_2_28_aarch64 + steps: + # Common part (same for nearly each build) + - uses: actions/checkout@v3 + with: + submodules: true + - name: Set WGPU_NATIVE_VERSION + run: echo "WGPU_NATIVE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + shell: bash + # prepare qemu for cross-compilation + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + # Build + - name: Build + run: | + CID=$(docker create --platform linux/arm64 -t -w /tmp/wgpu-native -v $PWD:/tmp/src:ro -e TARGET -e ARCHIVE_NAME -e WGPU_NATIVE_VERSION quay.io/pypa/$IMAGE bash -c "\ + cp -r /tmp/src/. . && \ + rm -rf ./dist && \ + export PATH=/root/.cargo/bin:\$PATH && \ + export USER=root && \ + curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none && \ + rustup toolchain install --no-self-update $TOOLCHAIN && \ + rustup default $TOOLCHAIN && \ + dnf install clang-devel zip -y && \ + make package") + docker start -ai $CID + mkdir -p dist + docker cp $CID:/tmp/wgpu-native/dist/. dist/. + docker rm $CID + # Upload (same for each build) + - name: Upload + uses: actions/upload-artifact@v3 + with: + path: dist + name: dist + # ----- windows-x86_64: # Config @@ -192,13 +239,13 @@ jobs: name: dist # ----- - macos-arm64: + macos-aarch64: # Config - name: release - macos-arm64 + name: release - macos-aarch64 runs-on: macos-latest env: TARGET: aarch64-apple-darwin - ARCHIVE_NAME: wgpu-macos-arm64 + ARCHIVE_NAME: wgpu-macos-aarch64 MACOSX_DEPLOYMENT_TARGET: "11.0" steps: # Common part (same for each build) @@ -232,7 +279,7 @@ jobs: publish: name: Publish Github release needs: - [linux-x86_64, windows-x86_64, windows-i686, macos-x86_64, macos-arm64] + [linux-x86_64, linux-aarch64, windows-x86_64, windows-i686, macos-x86_64, macos-aarch64] runs-on: ubuntu-latest if: success() && contains(github.ref, 'tags/v') steps: