Skip to content

[build] Build abi3 wheels #24

[build] Build abi3 wheels

[build] Build abi3 wheels #24

Workflow file for this run

name: Build Wheels
on:
push:
branches: 'master'
jobs:
Build-Wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, macos-15-intel, ubuntu-latest, ubuntu-24.04-arm, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade twine cibuildwheel build abi3audit
- name: Build Tarball
# Only one out of the OS matrix needs to build the tarball.
if: matrix.manylinux-image == 'manylinux2014' && matrix.os == 'ubuntu-latest'
run: python3 -m build --sdist
- name: Build Wheels
env:
CIBW_ARCHS: auto64
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux-image }}
run: python -m cibuildwheel --output-dir dist .
- name: Check Wheels
shell: bash
run: |
twine check dist/*
# https://blog.trailofbits.com/2022/11/15/python-wheels-abi-abi3audit/
test -n "$( find dist -name '*abi3*.whl' )" && abi3audit --strict --report dist/*abi3*.whl
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: "dist/*.whl"
Test-Wheel-Compatibility:
runs-on: ${{ matrix.os }}
needs: ['Build-Wheels']
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
os: [macos-latest, ubuntu-latest, ubuntu-24.04-arm, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
name: wheels-${{ matrix.os }}
- name: Test Installation From Wheel
shell: bash
run: |
python3 -m pip install --upgrade-strategy eager --upgrade pytest
python3 -m pip install --no-index --find-links . cppbktree
python3 -m pytest tests/test_*.py
- uses: actions/upload-artifact@v4
# Upload some wheels for manual inspection. We don't need all of them.
if: matrix.os == 'ubuntu-latest'
with:
name: Linux x86-64 CPython Wheels
path: "dist/*.whl"
Publish:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: ['Test-Wheel-Compatibility']
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade build twine
- uses: actions/download-artifact@v4
with:
path: dist
pattern: wheels-*
merge-multiple: true
- name: Build Tarball
run: python3 -m build --sdist
- name: Publish to PyPI
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload --skip-existing -u __token__ dist/*