-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Test build wheel | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_wheels: | ||
# env: | ||
# CIBW_ARCHS: all | ||
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} | ||
runs-on: ${{ matrix.buildplat[0] }} | ||
strategy: | ||
matrix: | ||
# From wheel.yml of numpy (https://github.com/numpy/numpy/blob/main/.github/workflows/wheels.yml): | ||
# Github Actions doesn't support pairing matrix values together, let's improvise | ||
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026 | ||
buildplat: | ||
- [ubuntu-20.04, manylinux_x86_64] | ||
- [ubuntu-20.04, musllinux_x86_64] | ||
- [macos-12, macosx_x86_64] | ||
- [windows-2019, win_amd64] | ||
- [windows-2019, win32] | ||
python: ["cp39", "cp310", "cp311", "cp312", "pp39"] | ||
exclude: | ||
# Don't build PyPy 32-bit windows | ||
- buildplat: [windows-2019, win32] | ||
python: "pp39" | ||
- buildplat: [ ubuntu-20.04, musllinux_x86_64 ] | ||
python: "pp39" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup MSVC (32-bit) | ||
if: ${{ matrix.buildplat[1] == 'win32' }} | ||
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1 | ||
with: | ||
architecture: 'x86' | ||
|
||
- name: Build wheels | ||
if: ${{ matrix.buildplat[1] == 'manylinux_x86_64' || matrix.buildplat[1] == 'musllinux_x86_64'}} | ||
uses: pypa/cibuildwheel@v2.16.1 | ||
env: | ||
CIBW_PRERELEASE_PYTHONS: True | ||
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | ||
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 | ||
|
||
- name: Build wheels | ||
if: ${{ matrix.buildplat[1] != 'manylinux_x86_64' && matrix.buildplat[1] != 'musllinux_x86_64'}} | ||
uses: pypa/cibuildwheel@v2.16.1 | ||
env: | ||
CIBW_PRERELEASE_PYTHONS: True | ||
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz |