From 0b2c3e9ddbd93b326d97229dcd93fa5f06357271 Mon Sep 17 00:00:00 2001 From: John Didion Date: Tue, 12 Sep 2023 10:41:00 -0700 Subject: [PATCH] Fix GHA workflow for multi-platform builds (#25) Enumerate the specific identifiers to build, and correctly set the cibuildwheel environment variables. --- .github/workflows/wheels.yml | 40 +++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9e96677..f555d6c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -7,12 +7,33 @@ on: jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} + name: Build wheels for ${{ matrix.python }}-${{ matrix.platform.target }}_${{ matrix.platform.arch }} on ${{ matrix.platform.os }} + runs-on: ${{ matrix.platform.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019, macOS-11] - PYTHON_VERSION: ["3.8", "3.9", "3.10", "3.11"] + python: [cp38, cp39, cp310, cp311] + platform: + - os: ubuntu-latest + target: manylinux + arch: x86_64 + - os: ubuntu-latest + target: musllinux + arch: x86_64 + # These don't work right now - they just hang while pulling the build image from quay. + # If this doesn't resolve itself, we could try to configure different images: + # https://cibuildwheel.readthedocs.io/en/stable/options/. + #- os: ubuntu-latest + # target: manylinux + # arch: aarch64 + #- os: ubuntu-latest + # target: musllinux + # arch: aarch64 + - os: macos-latest + target: macosx + arch: x86_64 + - os: macos-latest + target: macosx + arch: arm64 steps: - uses: actions/checkout@v4 @@ -21,16 +42,21 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v4 + with: + python-version: 3.8 - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.15.0 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - # to supply options, put them in 'env', like: - # env: - # CIBW_SOME_OPTION: value + env: + CIBW_ARCHS: ${{ matrix.platform.arch }} + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform.target }}_${{ matrix.platform.arch }} + CIBW_BUILD_VERBOSITY: 1 - uses: actions/upload-artifact@v3 with: + name: wheels path: ./wheelhouse/*.whl + if-no-files-found: error