Skip to content

Commit 8561b0d

Browse files
add linux/aarch64 support. (#326) (#328)
Co-authored-by: Daisuke Kato <[email protected]>
1 parent f326782 commit 8561b0d

File tree

1 file changed

+51
-4
lines changed

1 file changed

+51
-4
lines changed

.github/workflows/cd.yml

+51-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,53 @@ jobs:
7272
path: dist
7373
name: dist
7474

75+
# -----
76+
linux-aarch64:
77+
# Config
78+
name: release - linux-aarch64
79+
runs-on: ubuntu-latest
80+
env:
81+
TARGET: aarch64-unknown-linux-gnu
82+
ARCHIVE_NAME: wgpu-linux-aarch64
83+
TOOLCHAIN: stable-aarch64-unknown-linux-gnu
84+
IMAGE: manylinux_2_28_aarch64
85+
steps:
86+
# Common part (same for nearly each build)
87+
- uses: actions/checkout@v3
88+
with:
89+
submodules: true
90+
- name: Set WGPU_NATIVE_VERSION
91+
run: echo "WGPU_NATIVE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
92+
shell: bash
93+
# prepare qemu for cross-compilation
94+
- name: Set up QEMU
95+
uses: docker/setup-qemu-action@v3
96+
with:
97+
platforms: arm64
98+
# Build
99+
- name: Build
100+
run: |
101+
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 "\
102+
cp -r /tmp/src/. . && \
103+
rm -rf ./dist && \
104+
export PATH=/root/.cargo/bin:\$PATH && \
105+
export USER=root && \
106+
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none && \
107+
rustup toolchain install --no-self-update $TOOLCHAIN && \
108+
rustup default $TOOLCHAIN && \
109+
dnf install clang-devel zip -y && \
110+
make package")
111+
docker start -ai $CID
112+
mkdir -p dist
113+
docker cp $CID:/tmp/wgpu-native/dist/. dist/.
114+
docker rm $CID
115+
# Upload (same for each build)
116+
- name: Upload
117+
uses: actions/upload-artifact@v3
118+
with:
119+
path: dist
120+
name: dist
121+
75122
# -----
76123
windows-x86_64:
77124
# Config
@@ -192,13 +239,13 @@ jobs:
192239
name: dist
193240

194241
# -----
195-
macos-arm64:
242+
macos-aarch64:
196243
# Config
197-
name: release - macos-arm64
244+
name: release - macos-aarch64
198245
runs-on: macos-latest
199246
env:
200247
TARGET: aarch64-apple-darwin
201-
ARCHIVE_NAME: wgpu-macos-arm64
248+
ARCHIVE_NAME: wgpu-macos-aarch64
202249
MACOSX_DEPLOYMENT_TARGET: "11.0"
203250
steps:
204251
# Common part (same for each build)
@@ -232,7 +279,7 @@ jobs:
232279
publish:
233280
name: Publish Github release
234281
needs:
235-
[linux-x86_64, windows-x86_64, windows-i686, macos-x86_64, macos-arm64]
282+
[linux-x86_64, linux-aarch64, windows-x86_64, windows-i686, macos-x86_64, macos-aarch64]
236283
runs-on: ubuntu-latest
237284
if: success() && contains(github.ref, 'tags/v')
238285
steps:

0 commit comments

Comments
 (0)