Skip to content

Commit

Permalink
Add release job to publish macOS arm64 binaries (#246)
Browse files Browse the repository at this point in the history
* Add release job to publish macOS arm64 binaries

With the recent release of cibuildwheel 1.9.0 support for building arm64
binaries on macOS was added. This enables us to build release binaries
for this new platform. However, these binaries will be cross-compiled
and not tested since there are no CI resources with the platform
available. This commit adds a new release wheel job to build a aarch64
binary and publish an arm64 wheel for macOS. This will enable users who
have an arm64 mac to run retworkx without having to either build from
source or run under rosetta 2.

Fixes #231

* DNM: Testing the wheel builds

* Install aarch64-apple-darwin target

* Random guess at cross lib dir

* Update PYO3_CROSS_LIB path

* Revert "DNM: Testing the wheel builds"

Tested the wheel builds work and @nonhermitian confirmed the built
wheels worked on an arm64 mac locally.

This reverts commit 2a6ff1f.

* Install twine in arm64 wheel job

* Add release notes
  • Loading branch information
mtreinish authored Feb 9, 2021
1 parent 8d2fdcc commit e73c294
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
toolchain: stable
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.6.3 twine
python -m pip install cibuildwheel==1.9.0 twine
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
Expand All @@ -57,7 +57,6 @@ jobs:
CIBW_SKIP: cp27-* cp34-* cp35-* pp* *win32
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
CIBW_TEST_COMMAND: python -m unittest discover {project}/tests

- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
Expand All @@ -66,6 +65,33 @@ jobs:
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: retworkx-ci
build-mac-arm-wheels:
name: Build wheels on macos for arm
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: joerick/[email protected]
env:
CIBW_BEFORE_ALL: rustup target add aarch64-apple-darwin
CIBW_ARCHS_MACOS: arm64
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
CIBW_ENVIRONMENT: CARGO_BUILD_TARGET="aarch64-apple-darwin" PYO3_CROSS_LIB_DIR="/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9"
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
- name: Install cibuildwheel
run: |
python -m pip install twine
- name: Upload to PyPI
run: twine upload ./wheelhouse/*.whl
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: retworkx-ci
build-win32-wheels:
name: Build wheels on win32
runs-on: windows-latest
Expand All @@ -85,7 +111,7 @@ jobs:
run: rustup default stable-i686-pc-windows-msvc
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.6.3 twine
python -m pip install cibuildwheel==1.9.0 twine
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/arm64-mac-d45deda145e37b8f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
Starting with this release wheels will be published for macOS arm64. Only
Python 3.9 is supported at first, because it is the only version of
Python with native support for arm64 macOS.

0 comments on commit e73c294

Please sign in to comment.