Skip to content

Build Wheels (CPU)

Build Wheels (CPU) #45

name: Build Wheels (CPU)
on: workflow_dispatch
permissions:
contents: write
jobs:
# build_wheels_linux:
# name: Build wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-20.04]
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: "recursive"
# # Used to host cibuildwheel
# - uses: actions/setup-python@v5
# with:
# python-version: "3.8"
# cache: "pip"
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# # python -m pip install -e .
# python -m pip install build wheel
# - name: Build wheels
# uses: pypa/cibuildwheel@v2.20.0
# env:
# # disable repair
# CIBW_REPAIR_WHEEL_COMMAND: ""
# CIBW_BUILD_FRONTEND: "build"
# CIBW_SKIP: "*musllinux*"
# CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*"
# CMAKE_BUILD_PARALLEL_LEVEL: 4
# with:
# package-dir: .
# output-dir: wheelhouse
# - uses: actions/upload-artifact@v4
# with:
# name: wheels-${{ matrix.os }}
# path: ./wheelhouse/*.whl
build_wheels_win:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# here 'sdk-windows-8-core' is a large runner
os: [sdk-windows-8-core]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# python -m pip install -e .
python -m pip install build wheel
- name: Build wheels
uses: pypa/cibuildwheel@v2.20.0
env:
# disable repair
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_BUILD_FRONTEND: "build"
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*"
CMAKE_BUILD_PARALLEL_LEVEL: 16
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_ARGS="-DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=10.0.18362.0"'
with:
package-dir: .
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_wheels_arm64:
name: Build arm64 wheels
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.20.0
env:
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_BUILD_FRONTEND: "build"
CIBW_SKIP: "*musllinux* pp*"
CIBW_ARCHS: "aarch64"
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*"
CMAKE_BUILD_PARALLEL_LEVEL: $(nproc)
with:
output-dir: wheelhouse
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: wheels_arm64
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
python -m pip install -e .
- name: Build source distribution
run: |
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz
release:
name: Release
needs: [build_wheels_win, build_wheels_arm64, build_sdist] # build_wheels_linux
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- uses: softprops/action-gh-release@v2
with:
files: dist/*
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}