Skip to content

Move some cibuildwheel settings into pyproject.toml #28

Move some cibuildwheel settings into pyproject.toml

Move some cibuildwheel settings into pyproject.toml #28

Workflow file for this run

name: Build
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build_macos_wheels:
name: macOS (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-13, macos-14 ]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp312-*"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_linux_wheels:
runs-on: ubuntu-latest
name: Linux (${{ matrix.arch }}, ${{ matrix.tag }})
strategy:
matrix:
arch: [ x86_64, i686, aarch64, ppc64le, s390x ]
tag: [ manylinux, musllinux ]
# TODO(charlie): Fails to compile, root cause is unexplored.
exclude:
- arch: aarch64
tag: musllinux
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: ${{ matrix.arch }} != 'x86_64'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_BUILD: "cp312-${{ matrix.tag }}_*"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-linux-${{ matrix.arch }}-${{ matrix.tag }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
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: cibw-sdist
path: dist/*.tar.gz
# Verify that the x86_64 wheels work on macOS 11.
test_macos_11:
name: Test macOS 11
runs-on: macos-11
needs: build_macos_wheels
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cibw-wheels-macos-13-0
path: wheelhouse
- name: Install wheel
run: pip install wheelhouse/*.whl
- name: Test wheel
run: python -m whisper_cpp -h
upload_pypi:
needs: [ build_macos_wheels, build_linux_wheels, build_sdist ]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1