Fix GH Actions, make Python3.12 the oldest supported version #99
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Wheels | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build_sdist: | |
| name: Build SDist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Build SDist | |
| run: pipx run build --sdist | |
| - name: Check metadata | |
| run: pipx run twine check dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-sdist | |
| path: dist/*.tar.gz | |
| build_wheels: | |
| name: Build wheels on Linux | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x86_64] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Build wheels | |
| uses: pypa/[email protected] | |
| env: | |
| CIBW_PLATFORM: linux | |
| CIBW_ARCHS_LINUX: ${{ matrix.arch }} | |
| CIBW_BUILD: "cp312-* cp313-*" | |
| CIBW_SKIP: "*-musllinux*" | |
| CIBW_TEST_COMMAND: "python -c 'import pylibbpf; assert hasattr(pylibbpf, \"BpfObject\"), \"BpfObject not found\"; print(f\"pylibbpf {pylibbpf.__version__} OK\")'" | |
| CIBW_TEST_SKIP: "*-linux_aarch64" | |
| CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | |
| CIBW_BEFORE_ALL_LINUX: | | |
| dnf install -y elfutils-libelf-devel zlib-devel make gcc gcc-c++ git | |
| CIBW_BEFORE_BUILD: > | |
| pip install --upgrade "setuptools>=77.0.0" wheel cmake ninja pybind11 | |
| - name: Verify clean directory | |
| run: git diff --exit-code | |
| shell: bash | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-wheels-linux-${{ matrix.arch }} | |
| path: wheelhouse/*.whl | |
| upload_all: | |
| name: Upload to PyPI if release | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: pypi | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| pattern: cibw-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ |