| 1 |
name: Build wheels |
| 2 |
|
| 3 |
on: |
| 4 |
workflow_dispatch: |
| 5 |
release: |
| 6 |
pull_request: |
| 7 |
push: |
| 8 |
branches: |
| 9 |
- "*" |
| 10 |
|
| 11 |
jobs: |
| 12 |
build_wheels: |
| 13 |
name: ${{ matrix.os }} |
| 14 |
runs-on: ${{ matrix.os }} |
| 15 |
if: "contains(github.event.head_commit.message, 'build wheels')" |
| 16 |
strategy: |
| 17 |
matrix: |
| 18 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 19 |
|
| 20 |
steps: |
| 21 |
- uses: actions/checkout@v4 |
| 22 |
- name: Set up Python 3.10 |
| 23 |
uses: actions/setup-python@v5 |
| 24 |
with: |
| 25 |
python-version: "3.10" |
| 26 |
|
| 27 |
- name: Install dependencies |
| 28 |
run: | |
| 29 |
python -m pip install --upgrade pip setuptools |
| 30 |
|
| 31 |
- name: Install cibuildwheel |
| 32 |
run: | |
| 33 |
python -m pip install cibuildwheel==2.16.2 |
| 34 |
|
| 35 |
- name: Build wheels |
| 36 |
env: |
| 37 |
CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp* cp36* cp*musl* *i686" |
| 38 |
run: | |
| 39 |
python -m cibuildwheel --output-dir wheelhouse |
| 40 |
|
| 41 |
- uses: actions/upload-artifact@v4 |
| 42 |
with: |
| 43 |
name: wheels-${{ strategy.job-index }} |
| 44 |
path: ./wheelhouse |
| 45 |
|
| 46 |
|
| 47 |
build_all_wheels: |
| 48 |
name: ${{ matrix.os }} |
| 49 |
runs-on: ${{ matrix.os }} |
| 50 |
if: "contains(github.event.head_commit.message, 'build all wheels')" |
| 51 |
strategy: |
| 52 |
matrix: |
| 53 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 54 |
|
| 55 |
steps: |
| 56 |
- uses: actions/checkout@v4 |
| 57 |
- name: Set up Python 3.10 |
| 58 |
uses: actions/setup-python@v5 |
| 59 |
with: |
| 60 |
python-version: "3.10" |
| 61 |
|
| 62 |
- name: Install dependencies |
| 63 |
run: | |
| 64 |
python -m pip install --upgrade pip setuptools |
| 65 |
|
| 66 |
- name: Install cibuildwheel |
| 67 |
run: | |
| 68 |
python -m pip install cibuildwheel==2.16.2 |
| 69 |
|
| 70 |
- name: Set up QEMU |
| 71 |
if: runner.os == 'Linux' |
| 72 |
uses: docker/setup-qemu-action@v1 |
| 73 |
with: |
| 74 |
platforms: all |
| 75 |
|
| 76 |
- name: Build wheels |
| 77 |
env: |
| 78 |
CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp* cp*musl* *i686" |
| 79 |
CIBW_ARCHS_LINUX: auto aarch64 |
| 80 |
CIBW_ARCHS_MACOS: x86_64 universal2 arm64 |
| 81 |
run: | |
| 82 |
python -m cibuildwheel --output-dir wheelhouse |
| 83 |
|
| 84 |
- uses: actions/upload-artifact@v4 |
| 85 |
with: |
| 86 |
name: wheels-${{ strategy.job-index }} |
| 87 |
path: ./wheelhouse |
| 88 |
|