Merge pull request #8 from Natooz/dependabot/github_actions/pypa/cibu… #8
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
name: Test build wheel | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build_wheels: | |
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 | |
# https://cibuildwheel.pypa.io/en/stable/options/#build-skip | |
# https://cibuildwheel.pypa.io/en/stable/options/#archs | |
buildplat: # [os, dist, arch] | |
- [ubuntu-latest, manylinux_x86_64, x86_64] | |
- [ubuntu-latest, musllinux_x86_64, x86_64] | |
- [ubuntu-latest, manylinux_aarch64, aarch64] | |
- [ubuntu-latest, musllinux_aarch64, aarch64] | |
- [macos-13, macosx_x86_64, x86_64] | |
- [macos-14, macosx_arm64, arm64] | |
- [windows-2022, win32, x86] | |
- [windows-latest, win_amd64, AMD64] | |
# - [windows-latest, win_arm64, ARM64] | |
python: ["cp38", "cp39", "cp310", "cp311", "cp312", "pp39", "pp310"] | |
# PyPy is not supported for musllinux, win32 and windows arm64 | |
# CPython 3.8 is not supported on windows arm64 | |
exclude: | |
- buildplat: [ windows-2022, win32, x86 ] | |
python: "pp39" | |
- buildplat: [ windows-latest, win_arm64, ARM64 ] | |
python: "pp39" | |
- buildplat: [ ubuntu-latest, musllinux_x86_64, x86_64 ] | |
python: "pp39" | |
- buildplat: [ ubuntu-latest, musllinux_aarch64, aarch64 ] | |
python: "pp39" | |
- buildplat: [ windows-2022, win32, x86 ] | |
python: "pp310" | |
- buildplat: [ windows-latest, win_arm64, ARM64 ] | |
python: "pp310" | |
- buildplat: [ ubuntu-latest, musllinux_x86_64, x86_64 ] | |
python: "pp310" | |
- buildplat: [ ubuntu-latest, musllinux_aarch64, aarch64 ] | |
python: "pp310" | |
- buildplat: [ windows-latest, win_arm64, ARM64 ] | |
python: "cp38" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Required for linux arm64 | |
# https://cibuildwheel.pypa.io/en/stable/faq/#emulation | |
- name: Set up QEMU | |
if: ${{ contains(matrix.buildplat[1], 'linux_aarch64') }} | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Setup MSVC (32-bit) | |
if: ${{ matrix.buildplat[1] == 'win32' }} | |
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1 | |
with: | |
architecture: ${{ matrix.buildplat[2] }} | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_PRERELEASE_PYTHONS: True | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
CIBW_ARCHS: ${{ matrix.buildplat[2] }} | |
CIBW_ENVIRONMENT_MACOS: > | |
CFLAGS='-s' | |
CXXFLAGS='-s' | |
MACOSX_DEPLOYMENT_TARGET='10.15' | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build sdist | |
run: pipx run build --sdist |