- Bump actions/upload-artifact to v6, actions/setup-python to v6, actions/checkout to v5, and docker/setup-qemu-action to v4 so all actions run on Node 24 (Node 20 is deprecated on GitHub runners). - Bump pypa/cibuildwheel to v3.4.1 so its bundled actions/setup-python also runs on Node 24. - Drop CIBW_SKIP=pp*: PyPy is no longer enabled by default in cibuildwheel 3.x, so the selector matched nothing and triggered an "Invalid skip selector" warning. - Add CIBW_TEST_SKIP for cp38 macOS arm64 to silence the cibuildwheel warning that the arm64 slice of cp38 universal2 wheels can't be tested (the cp38 installer is x86_64-only).
112 lines
3.1 KiB
YAML
112 lines
3.1 KiB
YAML
name: Build
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build_wheels:
|
|
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
max-parallel: 99
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
arch: x86_64
|
|
- os: ubuntu-latest
|
|
arch: i686
|
|
- os: ubuntu-latest
|
|
arch: aarch64
|
|
- os: ubuntu-latest
|
|
arch: ppc64le
|
|
- os: ubuntu-latest
|
|
arch: s390x
|
|
|
|
- os: macos-15
|
|
arch: x86_64
|
|
- os: macos-15
|
|
arch: arm64
|
|
# Disabled until someone figures out how to build capnproto for arm64 and x86_64 simultaneously
|
|
# - os: macOS-latest
|
|
# arch: universal2
|
|
|
|
- os: windows-2022
|
|
arch: AMD64
|
|
- os: windows-2022
|
|
arch: x86
|
|
# Does not build currently
|
|
# - os: windows-2019
|
|
# arch: ARM64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Set up QEMU
|
|
if: runner.os == 'Linux'
|
|
uses: docker/setup-qemu-action@v4
|
|
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v3.4.1
|
|
with:
|
|
output-dir: wheelhouse
|
|
env:
|
|
CIBW_ARCHS: ${{ matrix.arch }}
|
|
CIBW_TEST_REQUIRES: pytest pytest-asyncio
|
|
CIBW_TEST_COMMAND: pytest {project}
|
|
# cibuildwheel can build cp38 macOS universal2/arm64 wheels but can't test the
|
|
# arm64 slice because the cp38 installer is x86_64-only. Silence the warning.
|
|
CIBW_TEST_SKIP: "cp38-macosx_*:arm64"
|
|
# Only needed to make the macosx arm64 build work
|
|
CMAKE_OSX_ARCHITECTURES: "${{ matrix.arch == 'arm64' && 'arm64' || '' }}"
|
|
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
|
|
path: ./wheelhouse/*.whl
|
|
|
|
build_sdist:
|
|
name: Build source distribution
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Build sdist
|
|
run: pipx run build --sdist
|
|
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: cibw-sdist
|
|
path: dist/*.tar.gz
|
|
|
|
lint:
|
|
name: Lint and format with ruff
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Lint and format with ruff
|
|
run: |
|
|
pip install ruff
|
|
ruff check .
|
|
ruff format --check .
|
|
|
|
# upload_pypi:
|
|
# needs: [build_wheels, build_sdist]
|
|
# runs-on: ubuntu-latest
|
|
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
# steps:
|
|
# - uses: actions/download-artifact@v3
|
|
# with:
|
|
# # unpacks default artifact into dist/
|
|
# # if `name: artifact` is omitted, the action will create extra parent dir
|
|
# name: artifact
|
|
# path: dist
|
|
|
|
# - uses: pypa/gh-action-pypi-publish@v1.5.0
|
|
# with:
|
|
# user: __token__
|
|
# password: ${{ secrets.PYPI_PASSWORD_RELEASE }}
|
|
|
|
# # password: ${{ secrets.PYPI_PASSWORD }}
|
|
# # repository_url: https://test.pypi.org/legacy/
|