Skip to content

Build wheels

Build wheels #23

Workflow file for this run

name: Build wheels
on:
# Only a manual trigger for now
workflow_dispatch:
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
build_wheel_linux:
name: Linux wheels
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
python: [cp36, cp37, cp38, cp39, cp310, cp311, cp312, cp313]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
if: matrix.arch != 'x86_64'
- uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.python }}-manylinux*
# Build free-threaded wheels once it is more widely supported
# CIBW_FREE_THREADED_SUPPORT: True
CIBW_TEST_REQUIRES: ""
CIBW_TEST_COMMAND: python -c "import gnureadline"
- uses: actions/upload-artifact@v4
with:
name: wheel_linux-${{ matrix.arch }}-${{ matrix.python }}
path: wheelhouse/*.whl
build_wheel_macos:
name: macOS wheels
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14]
python: [cp36, cp37, cp38, cp39, cp310, cp311, cp312, cp313]
exclude:
# Python < 3.9 not natively available for Apple Silicon.
# cibuildwheel tries to do a cross build, which fails.
- os: macos-14
python: cp36
- os: macos-14
python: cp37
- os: macos-14
python: cp38
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-macos*
# Build free-threaded wheels once it is more widely supported
# CIBW_FREE_THREADED_SUPPORT: True
CIBW_TEST_REQUIRES: ""
CIBW_TEST_COMMAND: python -c "import gnureadline"
- uses: actions/upload-artifact@v4
with:
name: wheel_${{ matrix.os }}-${{ matrix.python }}
path: wheelhouse/*.whl
combine:
needs: [build_sdist, build_wheel_linux, build_wheel_macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create paths
run: mkdir -p dist wheelhouse
- uses: actions/download-artifact@v4
with:
pattern: wheel_*
path: wheelhouse/
merge-multiple: true
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist/
merge-multiple: true
- uses: actions/upload-artifact@v4
with:
name: combined
path: |
dist/
wheelhouse/