|
| 1 | +name: build-linux-wheels |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build-manylinux-python: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + python-version: ["cp38-manylinux_x86_64", "cp39-manylinux_x86_64", "cp310-manylinux_x86_64", "cp311-manylinux_x86_64", "cp312-manylinux_x86_64", "cp313-manylinux_x86_64"] |
| 14 | + |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Set up Python (runner) |
| 19 | + uses: actions/setup-python@v5 |
| 20 | + with: |
| 21 | + python-version: '3.12' |
| 22 | + |
| 23 | + - name: Install build tooling |
| 24 | + run: | |
| 25 | + python -m pip install --upgrade pip |
| 26 | + python -m pip install --upgrade cibuildwheel twine |
| 27 | +
|
| 28 | + - name: Build manylinux wheels with cibuildwheel |
| 29 | + env: |
| 30 | + # Target CPython versions (align with former matrix) |
| 31 | + CIBW_BUILD: ${{ matrix.python-version }} |
| 32 | + # CIBW_BUILD: "cp310-manylinux_x86_64" |
| 33 | + # Skip PyPy & musllinux for now |
| 34 | + CIBW_SKIP: "pp* *musllinux*" |
| 35 | + # Install system deps (runs inside manylinux container) |
| 36 | + CIBW_BEFORE_ALL_LINUX: >- |
| 37 | + yum install -y epel-release && |
| 38 | + yum install -y cmake3 libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel mesa-libGLU-devel |
| 39 | + # Provide flags similar to prior pip-wheel-args (handled via env; setup.py could be adapted to read these) |
| 40 | + EXTRA_CMAKE_DEFINES: "-DUSE_AVX=Off -DCI_BUILD=On" |
| 41 | + # Verbosity |
| 42 | + CIBW_BUILD_VERBOSITY: "1" |
| 43 | + run: | |
| 44 | + # If needed, adapt setup.py to consume EXTRA_CMAKE_DEFINES; for now rely on defaults. |
| 45 | + python -m cibuildwheel --output-dir wheelhouse |
| 46 | +
|
| 47 | + - name: Upload wheels artifact |
| 48 | + uses: actions/upload-artifact@v4 |
| 49 | + with: |
| 50 | + name: pypbd-${{matrix.python-version}} |
| 51 | + path: wheelhouse |
| 52 | + if: always() |
| 53 | + |
| 54 | + - name: Publish wheels to PyPI |
| 55 | + if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
| 56 | + env: |
| 57 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
| 58 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 59 | + run: | |
| 60 | + twine upload wheelhouse/*-manylinux*.whl --skip-existing |
0 commit comments