enabling arm64 builds #18
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| pull_request: | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| workflow_dispatch: | |
| jobs: | |
| build_wheels: | |
| name: Wheel (${{ matrix.os }}, ${{ matrix.cibw_archs }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| cibw_archs: "x86_64" | |
| - os: ubuntu-22.04-arm | |
| cibw_archs: "aarch64" | |
| - os: macos-latest | |
| cibw_archs: "universal2" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Install uv for faster dependency installation (required on macOS, bundled in manylinux) | |
| - uses: astral-sh/setup-uv@v4 | |
| # Build wheels using cibuildwheel | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| env: | |
| # Build for Python 3.11+ | |
| CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-* cp314t-*" | |
| # Skip PyPy, musllinux, and 32-bit Linux | |
| CIBW_SKIP: "pp* *-musllinux_* *-manylinux_i686" | |
| # Use uv for faster dependency installation (10-100x faster than pip) | |
| CIBW_BUILD_FRONTEND: "build[uv]" | |
| # Target architecture per matrix entry (native compilation, no QEMU) | |
| CIBW_ARCHS: "${{ matrix.cibw_archs }}" | |
| CIBW_TEST_COMMAND: 'python -c "import netgraph_core; print(netgraph_core.__version__)"' | |
| CIBW_BEFORE_ALL_LINUX: "yum install -y libatomic || (apt-get update && apt-get install -y libatomic1) || apk add libatomic" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }}-${{ matrix.cibw_archs }} | |
| path: ./wheelhouse/*.whl | |
| build_sdist: | |
| name: Build SDist | |
| 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 | |
| test_wheels_centos_stream_9: | |
| name: Test wheels (CentOS Stream 9, py${{ matrix.python-version }}) | |
| needs: [build_wheels] | |
| runs-on: ubuntu-latest | |
| container: quay.io/centos/centos:stream9 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - name: Install Python | |
| run: dnf install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-pip | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: cibw-wheels-ubuntu-* | |
| path: wheelhouse | |
| merge-multiple: true | |
| - name: Install and test wheel | |
| run: | | |
| python${{ matrix.python-version }} -m pip install --upgrade pip | |
| python${{ matrix.python-version }} -m pip install netgraph-core --find-links wheelhouse/ | |
| python${{ matrix.python-version }} -c "import netgraph_core; print('CentOS Stream 9:', netgraph_core.__version__)" | |
| publish_pypi: | |
| name: Publish to PyPI | |
| needs: [build_wheels, build_sdist, test_wheels_centos_stream_9] | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write # Required for Trusted Publishing (OIDC) | |
| # Only publish on tag pushes | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: cibw-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |