Skip to content

Wheels

Wheels #27

Workflow file for this run

# Compile wheels
# Reference: https://nanobind.readthedocs.io/en/latest/packaging.html#step-6-build-wheels-in-the-cloud
name: Wheels
# Only on manual trigger
on:
workflow_dispatch:
# Publish Release need write permissions
permissions:
contents: write
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist-sdist
path: dist/*.tar.gz
build_wheels:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
# - name: linux_x86_64
# runner: ubuntu-latest
# env_arch_key: CIBW_ARCHS_LINUX
# arch: x86_64
- name: linux_aarch64
runner: ubuntu-latest
env_arch_key: CIBW_ARCHS_LINUX
arch: aarch64
# - name: windows_amd64
# runner: windows-latest
# env_arch_key: CIBW_ARCHS_WINDOWS
# arch: AMD64
# - name: windows_arm64
# runner: windows-latest
# env_arch_key: CIBW_ARCHS_WINDOWS
# arch: ARM64
# - name: macos_x86_64
# runner: macos-13
# env_arch_key: CIBW_ARCHS_MACOS
# arch: x86_64
# - name: macos_arm64
# runner: macos-14
# env_arch_key: CIBW_ARCHS_MACOS
# arch: arm64
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up QEMU (Linux aarch64 only)
if: startsWith(matrix.name, 'linux') && matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build wheels via cibuildwheel
uses: pypa/cibuildwheel@v2.22
env:
${{ matrix.env_arch_key }}: ${{ matrix.arch }}
# Optional: Skip test for windows arm64
CIBW_TEST_SKIP: ${{ matrix.arch == 'ARM64' && '*win*arm64*' || '' }}
# Set the manylinux standard for aarch64
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
- name: Verify clean directory
run: git diff --exit-code
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
name: dist-${{ matrix.name }}