Skip to content

Commit

Permalink
build wheels for Linux aarch64 (#51)
Browse files Browse the repository at this point in the history
build wheels for Linux aarch64

Fixes #48
  • Loading branch information
anthrotype authored Oct 4, 2021
1 parent 39dd41c commit ec787d4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
CIBW_ENVIRONMENT: BUILD_SKIA_FROM_SOURCE=0 SKIA_LIBRARY_DIR=build/download

jobs:
build:
build_wheels:
runs-on: ${{ matrix.os }}
env:
CIBW_ARCHS: ${{ matrix.arch }}
Expand Down Expand Up @@ -65,11 +65,45 @@ jobs:
name: skia_pathops-${{ matrix.os }}-${{ matrix.arch }}
path: wheelhouse/*.whl

build_aarch64_wheels:
runs-on: ubuntu-latest
strategy:
matrix:
# aarch64 uses qemu so it's slow, build each py version in parallel jobs
python: [37, 38, 39, 310]
arch: [aarch64]
env:
CIBW_BUILD: cp${{ matrix.python }}-*
CIBW_ARCHS: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: docker/[email protected]
with:
platforms: all
- name: Download pre-compiled libskia
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
if [ "$BUILD_SKIA_FROM_SOURCE" == "0" ]; then
pip install githubrelease
python ci/download_libskia.py -d "${SKIA_LIBRARY_DIR}" --cpu-arch "arm64"
fi
- name: Install dependencies
run: pip install cibuildwheel
- name: Build and Test Wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
name: skia_pathops-${{ matrix.python }}-linux-${{ matrix.arch }}
path: wheelhouse/*.whl

deploy:
# only run if the commit is tagged...
if: startsWith(github.ref, 'refs/tags/v')
# ... and all build jobs completed successfully
needs: [build]
needs: [build_wheels, build_aarch64_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
11 changes: 7 additions & 4 deletions ci/download_libskia.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
PLATFORM_TAGS = {"Linux": "linux", "Darwin": "mac", "Windows": "win"}
CURRENT_PLATFORM = PLATFORM_TAGS.get(platform.system())
SUPPORTED_CPU_ARCHS = {
"linux": {"x64"},
"linux": {"x64", "arm64"},
"mac": {"x64", "arm64", "universal2"},
"win": {"x64", "x86"},
}
machine = get_platform().split("-")[-1]
CURRENT_CPU_ARCH = {"win32": "x86", "amd64": "x64", "x86_64": "x64"}.get(
machine, machine
)
CURRENT_CPU_ARCH = {
"win32": "x86",
"amd64": "x64",
"x86_64": "x64",
"aarch64": "arm64",
}.get(machine, machine)


logger = logging.getLogger()
Expand Down

0 comments on commit ec787d4

Please sign in to comment.