-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build wheels for MacOS for X86 and ARM64 (#976)
- Loading branch information
Showing
3 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,14 +19,15 @@ jobs: | |
matrix: | ||
os: [windows-latest] | ||
steps: | ||
- uses: actions/checkout@v4.1.1 | ||
- uses: actions/checkout@v4.2.2 | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.16.5 | ||
uses: pypa/cibuildwheel@v2.22.0 | ||
env: | ||
CIBW_BUILD: "*-win_amd64" | ||
CIBW_SKIP: "cp36-* pp*" | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4.4.3 | ||
with: | ||
name: wheels_windows64__${{ github.sha }} | ||
path: ./wheelhouse/*.whl | ||
|
||
build_wheels_windows_32: | ||
|
@@ -36,26 +37,27 @@ jobs: | |
matrix: | ||
os: [windows-latest] | ||
steps: | ||
- uses: actions/checkout@v4.1.1 | ||
- uses: actions/checkout@v4.2.2 | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.16.5 | ||
uses: pypa/cibuildwheel@v2.22.0 | ||
env: | ||
CIBW_BUILD: "*-win32" | ||
CIBW_SKIP: "cp36-* pp*" | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4.4.3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
build_wheels_macos_linux: | ||
name: wheels_windows32__${{ github.sha }} | ||
path: ./wheelhouse/*.whl | ||
|
||
build_wheels_linux: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# macos-13 is an intel runner, macos-14 is apple silicon | ||
os: [macos-13,macos-14,ubuntu-latest] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4.2.2 | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.16.5 | ||
uses: pypa/cibuildwheel@v2.22.0 | ||
env: | ||
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | ||
CIBW_SKIP: "cp36-* *-musllinux_* pp* *-*linux_{aarch64,ppc64le}" | ||
|
@@ -72,14 +74,60 @@ jobs: | |
--exclude libdl.so.2 | ||
--wheel-dir {dest_dir} | ||
{wheel} | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/[email protected] | ||
with: | ||
name: wheels_linux__${{ github.sha }} | ||
path: ./wheelhouse/*.whl | ||
|
||
build_macos_arm64_wheels: | ||
name: Build wheels on macOS ARM64 | ||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_SKIP: "cp36-*" | ||
- name: Upload wheels | ||
uses: actions/[email protected] | ||
with: | ||
name: wheels_macos_arm64__${{ github.sha }} | ||
path: ./wheelhouse/*.whl | ||
|
||
build_wheels_macos_x86: | ||
name: Build wheels for macOS x86_64 | ||
runs-on: macos-13 | ||
|
||
strategy: | ||
matrix: | ||
architecture: [x86_64] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install cibuildwheel # Install cibuildwheel to build the wheels | ||
- name: Set macOS deployment target | ||
run: echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV | ||
|
||
- name: Build wheels with cibuildwheel | ||
run: | | ||
CIBW_ARCHS_MACOS="${{ matrix.architecture }}" | ||
python -m cibuildwheel --platform macos --output-dir ./wheelhouse | ||
- name: Upload wheels as artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: wheels_macosx86_python313__${{ github.sha }} | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4.2.2 | ||
- name: Install Python dependencies | ||
run: python -m pip install --upgrade pip build | ||
- name: Build sdist | ||
|
@@ -102,14 +150,14 @@ jobs: | |
env: | ||
VERSION: ${{ steps.version.outputs.VERSION}} | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4.4.3 | ||
with: | ||
path: | | ||
./dist/*.tar.gz | ||
upload_pypi: | ||
needs: [build_sdist,build_wheels_macos_linux, build_wheels_windows_64,build_wheels_windows_32] | ||
needs: [build_sdist,build_wheels_linux, build_wheels_windows_64,build_wheels_windows_32, build_macos_arm64_wheels, build_wheels_macos_x86] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
|
@@ -129,4 +177,3 @@ jobs: | |
- name: Publish distribution to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
[tool.cibuildwheel.macos] | ||
[tool.cibuildwheel.macos] | ||
repair-wheel-command = "delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" | ||
skip = "cp36-macosx_x86_64" |