Skip to content

fixup! wip

fixup! wip #18

Workflow file for this run

name: Build Wheels
on:
push:
branches: '**'
jobs:
Build-Wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
archs: [auto64]
# manylinux1 is not supported anymore because it won't compile C++17 code
# manylinux_2_24, which is newer than manylinux2014, is not supported because it comes with GCC 5.3,
# which cannot compile C++17 code. Just why?
# https://github.com/pypa/manylinux/issues/1012
# manylinux_2_28 has GCC 11 :3 but it has dropped support for i686 (x86 32-bit).
# manylinux2010 runs into this problem https://github.com/pypa/cibuildwheel/issues/1001
# MacOS and Windows ignore the manylinux-image version because they are not Linux.
include:
- os: ubuntu-latest
manylinux-image: manylinux2014
archs: auto64
- os: ubuntu-latest
manylinux-image: manylinux2014
archs: auto32
- os: ubuntu-latest
manylinux-image: manylinux_2_28
archs: auto64
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: ${{ matrix.archs }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux-image }}
# Skip because because free-threaded CPython does not work with the ABI3:
# https://github.com/pypa/cibuildwheel/issues/2531#issuecomment-3168087550
CIBW_SKIP: "*cp31[4-9]*t"
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 --no-index --find-links . cppbktree
python3 tests/test_fast-zip-decryption.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/*