Skip to content

Build Python Wheels #86

Build Python Wheels

Build Python Wheels #86

Workflow file for this run

name: Build Python Wheels
on:
workflow_dispatch:
release:
types: ["created"]
env:
BUILD_TYPE: Release
jobs:
build_wheels_x86_64:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Latest, GCC",
os: ubuntu-latest,
arch: x86_64,
}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.18.1
- name: Build wheels
run: |
python --version
python -m cibuildwheel --output-dir dist
env:
CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=${{ matrix.config.arch == 'macosx_x86_64' && 'x86_64' || matrix.config.arch == 'macosx_arm64' && 'arm64' || '' }}
CIBW_BUILD: "cp312-*64"
MACOSX_DEPLOYMENT_TARGET: "10.14" # min supporting c++17
CIBW_PRERELEASE_PYTHONS: True
CIBW_SKIP: "*-win32"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_ARCHS_MACOS: "x86_64 universal2"
CIBW_ARCHS_LINUX: ${{ matrix.config.arch }}
CIBW_BEFORE_TEST: 'if [ "$CIBW_PYTHON_VERSION" = "cp310" ]; then pip install pytest numpy; fi'
CIBW_TEST_COMMAND: |
if [ "$CIBW_PYTHON_VERSION" = "cp310" ]; then python -m pytest {package}/python/tests; fi
- uses: actions/upload-artifact@v4
with:
name: x86_64_wheels
path: ./dist/*.whl
build_wheels_manylinux:
name: "ARM Manylinux Wheels"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Set up Qemu for ARM builds
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.18.1
- name: Build ARM wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
CIBW_BUILD: "cp312-*64"
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_ARCHS_LINUX: "aarch64"
CIBW_BEFORE_TEST: |
if [ "$CIBW_PYTHON_VERSION" = "cp310" ]; then pip install pytest numpy; fi
CIBW_TEST_COMMAND: |
if [ "$CIBW_PYTHON_VERSION" = "cp310" ]; then python -m pytest {package}/python/tests; fi
- uses: actions/upload-artifact@v4
with:
name: ManylinuxARMwheels
path: ./dist/*.whl
build_wheels_musllinux:
name: "ARM Musllinux Wheels"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Set up Qemu for ARM builds
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.18.1
- name: Build Musllinux ARM wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_SKIP: "*-win32 *-manylinux_i686 *-manylinux*"
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_LINUX: "aarch64"
CIBW_BEFORE_TEST: |
if [ "$CIBW_PYTHON_VERSION" = "cp310" ]; then pip install pytest numpy; fi
CIBW_TEST_COMMAND: |
if [ "$CIBW_PYTHON_VERSION" = "cp310" ]; then python -m pytest {package}/python/tests; fi
- uses: actions/upload-artifact@v4
with:
name: MusllinuxARMwheels
path: ./dist/*.whl