-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add macOS arm64 support and use latest runners for cibuildwheel
- Loading branch information
Showing
4 changed files
with
57 additions
and
44 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 |
---|---|---|
|
@@ -43,26 +43,37 @@ jobs: | |
# github actions syntax doesn't allow us to have yaml structures as | ||
# an input to a job. These environment variables are literal json strings | ||
MATRIX_PULL_REQUEST: | | ||
{ | ||
"include": [ | ||
{"os": "ubuntu-latest", "CIBW_BUILD": "cp37-manylinux_*", "CIBW_ARCHS": "x86_64"}, | ||
{"os": "ubuntu-latest", "CIBW_BUILD": "cp37-musllinux_*", "CIBW_ARCHS": "x86_64"}, | ||
{"os": "macos-12", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "x86_64"}, | ||
{"os": "windows-2022", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "AMD64"} | ||
] | ||
} | ||
MATRIX_WORKFLOW_DISPATCH: | | ||
{ | ||
"include": [ | ||
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_*", "CIBW_ARCHS": "x86_64"}, | ||
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_*", "CIBW_ARCHS": "aarch64"}, | ||
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_*", "CIBW_ARCHS": "x86_64"}, | ||
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_*", "CIBW_ARCHS": "aarch64"}, | ||
{"os": "macos-12", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "x86_64"}, | ||
{"os": "windows-2022", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "x86"}, | ||
{"os": "windows-2022", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "AMD64"} | ||
] | ||
} | ||
os: ["windows-latest", "ubuntu-latest", "macos-14"] | ||
python: "312" | ||
platform_id: | ||
- win_amd64 | ||
- win32 | ||
- manylinux_x86_64 | ||
- manylinux_aarch64 | ||
- musllinux_x86_64 | ||
- musllinux_aarch64 | ||
- macosx_x86_64 | ||
exclude: | ||
# Skip certain Python, Linux and Mac builds on Windows | ||
- os: windows-latest | ||
platform_id: manylinux_aarch64 | ||
platform_id: manylinux_x86_64 | ||
platform_id: macosx_x86_64 | ||
platform_id: musllinux_x86_64 | ||
platform_id: musllinux_aarch64 | ||
# Skip certain Python, Mac and Windows builds on Linux | ||
- os: ubuntu-latest | ||
platform_id: macosx_x86_64 | ||
platform_id: win_amd64 | ||
platform_id: win32 | ||
# Skip certain Python, Linux and Windows builds on Mac | ||
- os: macos-14 | ||
platform_id: win_amd64 | ||
platform_id: win32 | ||
platform_id: manylinux_x86_64 | ||
platform_id: manylinux_aarch64 | ||
platform_id: musllinux_x86_64 | ||
platform_id: musllinux_aarch64 | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
|
@@ -82,12 +93,14 @@ jobs: | |
|
||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.configure_matrix.outputs.matrix) }} | ||
matrix: ${{ outputs.matrix }} | ||
|
||
env: | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BUILD: ${{ matrix.CIBW_BUILD }} | ||
CIBW_ARCHS: ${{ matrix.CIBW_ARCHS }} | ||
CIBW_ARCHS_LINUX: "x86_64, aarch64" | ||
CIBW_ARCHS_MACOS: "x86_64, arm64" | ||
CIBW_ARCHS_WINDOWS: "AMD64, x86" | ||
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} | ||
CIBW_TEST_SKIP: "*-win32" | ||
|
||
steps: | ||
|
@@ -99,50 +112,50 @@ jobs: | |
id: cache-wheel | ||
with: | ||
path: wheelhouse | ||
key: wheel-${{ matrix.CIBW_BUILD }}-${{ matrix.CIBW_ARCHS }}-${{ github.sha }} | ||
key: wheel-${{ matrix.os }}-${{ matrix.platform_id }}-${{ github.sha }} | ||
|
||
- uses: docker/setup-qemu-action@v3 | ||
if: steps.cache-wheel.outputs.cache-hit != 'true' && runner.os == 'Linux' | ||
|
||
- uses: pypa/[email protected] | ||
if: steps.cache-wheel.outputs.cache-hit != 'true' | ||
|
||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: wheelhouse/*.whl | ||
name: wheels | ||
name: wheels-${{ matrix.os }}-${{ matrix.platform_id }} | ||
|
||
upload_pypi: | ||
needs: build_wheels | ||
runs-on: ubuntu-latest | ||
if: needs.build_wheels.result == 'success' && github.event.inputs.publish == 'PUBLISH' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: wheels | ||
pattern: wheels-* | ||
path: wheelhouse | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: wheelhouse | ||
skip_existing: true | ||
packages-dir: wheelhouse | ||
skip-existing: true | ||
|
||
upload_pypi_test: | ||
needs: build_wheels | ||
runs-on: ubuntu-latest | ||
if: needs.build_wheels.result == 'success' && github.event.inputs.publish_test == 'PUBLISH_TEST' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: wheels | ||
pattern: wheels-* | ||
path: wheelhouse | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
packages_dir: wheelhouse | ||
skip_existing: true | ||
packages-dir: wheelhouse | ||
skip-existing: true | ||
repository_url: https://test.pypi.org/legacy/ |
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
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