From 1ffc6e019d47a4a3554c0f570872555ecd472162 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Wed, 30 Oct 2024 13:23:14 -0400 Subject: [PATCH] github actions: fixes for trying to build all wheels using cibuildwheel --- .github/workflows/build_wheels.yml | 53 ++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 4794424..cc5de57 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -3,19 +3,14 @@ name: Build wheels on: [push, pull_request] jobs: - build_wheels: + build_wheels_linux: name: ${{ matrix.os }}-${{ matrix.architecture }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - architecture: [x86_64] - include: - - os: ubuntu-latest - architecture: aarch64 - - os: macos-latest - architecture: arm64 + architecture: [x86_64, aarch64] steps: - name: Checkout repository @@ -25,6 +20,50 @@ jobs: run: | python -m pip install --upgrade pip pip install cibuildwheel + + - name: Setup variables for aarch64 + if: matrix.architecture == 'aarch64' + env: + CIBW_PLATFORM: "linux_aarch64" + CIBW_EMULATOR: "linux/aarch64" + + - name: Build wheels with cibuildwheel + env: + CIBW_ARCHS_LINUX: ${{ matrix.architecture }} + CIBW_SKIP: "cp36-* cp37-*" + run: | + cibuildwheel --output-dir wheelhouse + + - name: List wheels + run: | + ls wheelhouse + + - name: Upload wheels as artifact + uses: actions/upload-artifact@v3 + with: + name: python-wheels + path: wheelhouse/*.whl + + build_wheels_mac: + name: ${{ matrix.os }}-${{ matrix.architecture }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest] + architecture: [x86_64, arm64] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + pip install cibuildwheel + + - name: Set macOS Deployment Target + export MACOSX_DEPLOYMENT_TARGET=11.0 - name: Build wheels with cibuildwheel env: