build-wheels #191
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: build-wheels | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build wheel for ${{ matrix.buildplat[1] }} ${{ matrix.python }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
fail-fast: false | |
matrix: | |
buildplat: | |
- [ubuntu-20.04, manylinux_x86_64] | |
- [macos-13, macosx_x86_64] | |
- [macos-14, macosx_arm64] | |
- [windows-2019, win_amd64] | |
python: ["cp38", "cp39", "cp310", "cp311", "cp312"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Select Xcode for macosx_x86_64 | |
if: matrix.buildplat[1] == 'macosx_x86_64' | |
run: sudo xcode-select -s /Applications/Xcode_15.2.app | |
- name: Select Xcode for macosx_arm64 | |
if: matrix.buildplat[1] == 'macosx_arm64' | |
run: sudo xcode-select -s /Applications/Xcode_15.4.app | |
- name: Install packages for macos | |
if: ${{ contains(matrix.buildplat[1], 'macosx') }} | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
brew update | |
brew install ninja libomp | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
if: ${{ matrix.python }} == 'cp38' && runner.os == 'macOS' && runner.arch == 'ARM64' | |
- name: Build wheels for manylinux_x86_64 | |
if: matrix.buildplat[1] == 'manylinux_x86_64' | |
uses: pypa/cibuildwheel@v2.19 | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
- name: Build wheels for macosx_x86_64 | |
if: matrix.buildplat[1] == 'macosx_x86_64' | |
uses: pypa/cibuildwheel@v2.19 | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
CIBW_ENVIRONMENT_MACOS: > | |
CC=gcc-14 | |
CXX=g++-14 | |
MACOSX_DEPLOYMENT_TARGET=13.0 | |
- name: Build wheels for macosx_arm64 | |
if: matrix.buildplat[1] == 'macosx_arm64' | |
uses: pypa/cibuildwheel@v2.19 | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
CIBW_ENVIRONMENT_MACOS: > | |
CC=gcc-14 | |
CXX=g++-14 | |
MACOSX_DEPLOYMENT_TARGET=14.0 | |
- name: Build wheels for windows | |
if: ${{ contains(matrix.buildplat[1], 'win') }} | |
uses: pypa/cibuildwheel@v2.19 | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" | |
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
shell: bash -l {0} | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz |