Skip to content

Commit ec787d4

Browse files
authored
build wheels for Linux aarch64 (#51)
build wheels for Linux aarch64 Fixes #48
1 parent 39dd41c commit ec787d4

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

.github/workflows/ci.yml

+36-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
CIBW_ENVIRONMENT: BUILD_SKIA_FROM_SOURCE=0 SKIA_LIBRARY_DIR=build/download
2121

2222
jobs:
23-
build:
23+
build_wheels:
2424
runs-on: ${{ matrix.os }}
2525
env:
2626
CIBW_ARCHS: ${{ matrix.arch }}
@@ -65,11 +65,45 @@ jobs:
6565
name: skia_pathops-${{ matrix.os }}-${{ matrix.arch }}
6666
path: wheelhouse/*.whl
6767

68+
build_aarch64_wheels:
69+
runs-on: ubuntu-latest
70+
strategy:
71+
matrix:
72+
# aarch64 uses qemu so it's slow, build each py version in parallel jobs
73+
python: [37, 38, 39, 310]
74+
arch: [aarch64]
75+
env:
76+
CIBW_BUILD: cp${{ matrix.python }}-*
77+
CIBW_ARCHS: ${{ matrix.arch }}
78+
steps:
79+
- uses: actions/checkout@v2
80+
with:
81+
submodules: recursive
82+
- uses: docker/[email protected]
83+
with:
84+
platforms: all
85+
- name: Download pre-compiled libskia
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
88+
run: |
89+
if [ "$BUILD_SKIA_FROM_SOURCE" == "0" ]; then
90+
pip install githubrelease
91+
python ci/download_libskia.py -d "${SKIA_LIBRARY_DIR}" --cpu-arch "arm64"
92+
fi
93+
- name: Install dependencies
94+
run: pip install cibuildwheel
95+
- name: Build and Test Wheels
96+
run: python -m cibuildwheel --output-dir wheelhouse
97+
- uses: actions/upload-artifact@v2
98+
with:
99+
name: skia_pathops-${{ matrix.python }}-linux-${{ matrix.arch }}
100+
path: wheelhouse/*.whl
101+
68102
deploy:
69103
# only run if the commit is tagged...
70104
if: startsWith(github.ref, 'refs/tags/v')
71105
# ... and all build jobs completed successfully
72-
needs: [build]
106+
needs: [build_wheels, build_aarch64_wheels]
73107
runs-on: ubuntu-latest
74108
steps:
75109
- uses: actions/checkout@v2

ci/download_libskia.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020
PLATFORM_TAGS = {"Linux": "linux", "Darwin": "mac", "Windows": "win"}
2121
CURRENT_PLATFORM = PLATFORM_TAGS.get(platform.system())
2222
SUPPORTED_CPU_ARCHS = {
23-
"linux": {"x64"},
23+
"linux": {"x64", "arm64"},
2424
"mac": {"x64", "arm64", "universal2"},
2525
"win": {"x64", "x86"},
2626
}
2727
machine = get_platform().split("-")[-1]
28-
CURRENT_CPU_ARCH = {"win32": "x86", "amd64": "x64", "x86_64": "x64"}.get(
29-
machine, machine
30-
)
28+
CURRENT_CPU_ARCH = {
29+
"win32": "x86",
30+
"amd64": "x64",
31+
"x86_64": "x64",
32+
"aarch64": "arm64",
33+
}.get(machine, machine)
3134

3235

3336
logger = logging.getLogger()

0 commit comments

Comments
 (0)