Skip to content

Commit

Permalink
Merge pull request #335 from apache/4.0-arm64-wheels
Browse files Browse the repository at this point in the history
Cherry-pick ARM64 wheels support
  • Loading branch information
jmalkin authored Jan 24, 2023
2 parents 858a359 + 1294f6f commit 84edaf4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
45 changes: 26 additions & 19 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ name: Build Python Wheels
on:
# allow manual runs
workflow_dispatch:

# run when we tag a release
release:
types:
- "created"
#release:
# types:
# - "created"

env:
BUILD_TYPE: Release
Expand All @@ -29,15 +30,14 @@ jobs:
- name: Build sdist
run: python -m build --sdist --outdir dist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

build_wheels:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
#fail-fast: false
matrix:
config:
- {
Expand All @@ -55,6 +55,12 @@ jobs:
os: ubuntu-latest,
cibw-arch: manylinux_x86_64
}
- {
name: "Ubuntu Latest (ARM64)",
os: ubuntu-latest,
cibw-arch: manylinux_aarch64,
use-qemu: true
}
- {
name: "Ubuntu Latest (i686)",
os: ubuntu-latest,
Expand All @@ -66,7 +72,6 @@ jobs:
cibw-arch: win_amd64
}


steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -75,25 +80,27 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.x'


- name: Set up QEMU for linux/arm64 builds
if: runner.os == 'Linux' && matrix.config.use-qemu == true
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Install Python dependencies
run: python -m pip install cibuildwheel==2.5.0

- name: Configure cibuildwheel
shell: bash
run: |
CMAKE_OSX_ARCHITECTURES=${{ matrix.config.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.config.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.config.cibw-arch == 'macosx_universal2' && '"arm64;x86_64"' || '' }}
echo "CIBW_ARCHS_MACOS=x86_64 arm64" >> $GITHUB_ENV
echo "CIBW_BUILD=*-${{ matrix.config.cibw-arch }}" >> $GITHUB_ENV
echo "CIBW_ENVIRONMENT_MACOS=CMAKE_OSX_ARCHITECTURES=\"$CMAKE_OSX_ARCHITECTURES\"" >> $GITHUB_ENV
run: python -m pip install cibuildwheel==2.12.0

- name: Build wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_ARCHS_LINUX: "auto aarch64"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=${{ matrix.config.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.config.cibw-arch == 'macosx_arm64' && 'arm64' || '' }}
CIBW_BUILD: "*-${{ matrix.config.cibw-arch }}"
CIBW_BEFORE_BUILD_LINUX: "yum remove -y cmake"
CIBW_BEFORE_BUILD: "python -m pip install cmake>=3.18"
CIBW_SKIP: "*-win32 pp*-macosx*"
CIBW_SKIP: "*-win32 pp*-aarch64 pp*-macosx"

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl
2 changes: 1 addition & 1 deletion version.cfg.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.0.1

0 comments on commit 84edaf4

Please sign in to comment.