Package Builder #9
This file contains 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: Package Builder | |
on: | |
push: | |
tags: | |
- 'v*.*' | |
workflow_dispatch: | |
jobs: | |
build_manylinux2014: | |
name: Build wheels on manylinux2014 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pypa/cibuildwheel@v2.19.2 | |
env: | |
CIBW_BUILD: "*-manylinux_x86_64 *-manylinux_i686 *-manylinux_aarch64" | |
CIBW_SKIP: "cp36-* cp37-* cp38-* pp*" | |
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014" | |
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014" | |
CIBW_BEFORE_ALL_LINUX: > | |
yum install -y wget && | |
wget https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz && | |
tar -xf v8.0.2.tar.gz && | |
cd qhull-8.0.2 && | |
cmake -S . -B build && | |
cmake --build build --target install | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_manylinux_2_28: | |
name: Build wheels on manylinux_2_28 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pypa/cibuildwheel@v2.19.2 | |
env: | |
CIBW_BUILD: "*-manylinux_x86_64 *-manylinux_aarch64" | |
CIBW_SKIP: "cp36-* cp37-* cp38-* pp*" | |
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" | |
CIBW_MANYLINUX_I686_IMAGE: "manylinux_2_28" | |
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" | |
# See https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/ | |
CIBW_BEFORE_ALL_LINUX: > | |
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux && | |
yum install -y wget && | |
wget https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz && | |
tar -xf v8.0.2.tar.gz && | |
cd qhull-8.0.2 && | |
cmake -S . -B build && | |
cmake --build build --target install | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_musllinux: | |
name: Build wheels on musllinux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pypa/cibuildwheel@v2.19.2 | |
env: | |
CIBW_BUILD: "*-musllinux_x86_64 *-musllinux_i686 *-musllinux_aarch64" | |
CIBW_SKIP: "cp36-* cp37-* cp38-* pp*" | |
CIBW_BEFORE_ALL_LINUX: > | |
apk update && | |
apk add wget && | |
wget https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz && | |
tar -xf v8.0.2.tar.gz && | |
cd qhull-8.0.2 && | |
cmake -S . -B build && | |
cmake --build build --target install | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_macos: | |
name: Build wheels on MacOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pypa/cibuildwheel@v2.19.2 | |
env: | |
CIBW_SKIP: "cp36-* cp37-* cp38-* pp*" | |
CIBW_ARCHS_MACOS: "x86_64 universal2" | |
CIBW_BEFORE_ALL_MACOS: > | |
wget https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz && | |
tar -xf v8.0.2.tar.gz && | |
cd qhull-8.0.2 && | |
cmake -DCMAKE_OSX_ARCHITECTURES='x86_64;arm64' -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_APPLICATIONS=OFF -S . -B build && | |
sudo cmake --build build --target install | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
name: Build wheels for Windows (${{ matrix.python-version }}) | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
- uses: johnwason/vcpkg-action@v6 | |
with: | |
manifest-dir: ${{ github.workspace }} | |
triplet: x64-windows-static | |
token: ${{ github.token }} | |
github-binarycache: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install build dependencies (pip) | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade setuptools wheel pip-tools ninja scikit_build_core | |
python -m piptools compile --resolver=backtracking -o requirements.txt pyproject.toml | |
pip install -r requirements.txt | |
- name: Build Python ${{ matrix.python-version }} wheel | |
run: python -m build -w | |
env: | |
CMAKE_GENERATOR: "Ninja" | |
CMAKE_TOOLCHAIN_FILE: "${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" | |
SKBUILD_CMAKE_ARGS: "-DVCPKG_TARGET_TRIPLET=x64-windows-static;-DVCPKG_MANIFEST_MODE=OFF" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install python dependencies | |
run: pip install build | |
- name: Build sdist | |
run: python -m build -s | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
name: Upload wheel to PyPI | |
needs: [build_manylinux2014, build_manylinux_2_28, build_musllinux, build_macos, build_windows] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@v1.8.5 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |