Skip to content

Commit

Permalink
feat: build wheels with cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Apr 19, 2024
1 parent 06b3d23 commit e986515
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
42 changes: 40 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

jobs:
bindings:
test-bindings:
strategy:
fail-fast: false

Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }}

name: "🐍 Build Bindings on ${{ matrix.os }}"
name: "🐍 Test Bindings on ${{ matrix.os }}"

steps:
- name: 📥 Checkout
Expand Down Expand Up @@ -54,3 +54,41 @@ jobs:
with:
name: Pre-Built (${{ matrix.os }})
path: venv

package:
strategy:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}
container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }}

name: "🐍 Package Bindings on ${{ matrix.os }}"

steps:
- name: 📥 Checkout
uses: actions/checkout@v3

- name: 🖥️ Setup Environment
uses: ./.github/actions/setup
with:
container: ${{ matrix.os }}
install-vtk: false

- uses: actions/setup-python@v3

- name: 🛞 CIBuildWheel
run: python -m pip install cibuildwheel==2.17.0

- name: 🏗️ Build Wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
SKBUILD_CONFIGURE_OPTIONS: ${{ matrix.os == 'ubuntu-latest' && '-DVIENNALS_VTK_PYTHON_LIBS=ON' || '-DVIENNALS_PACKAGE_PYTHON=ON' }}

- name: 📦 Upload Artifact
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ option(VIENNALS_BUILD_TESTS "Build tests" OFF)
# └ See: https://github.com/ViennaTools/ViennaPS/blob/c76e371817a797dfe2800691f00cb93317b731fa/CMakeLists.txt#L30
# --------------------------------------------------------------------------------------------------------

if(VIENNALS_VTK_PYTHON_LIBS AND VIENNALS_PACKAGE_PYTHON)
message(STATUS "[ViennaLS] Disabling `VIENNALS_PACKAGE_PYTHON` in favor of `VIENNALS_VTK_PYTHON_LIBS`")
set(VIENNALS_PACKAGE_PYTHON OFF)
endif()

if(VIENNALS_PACKAGE_PYTHON)
message(
STATUS
Expand Down

0 comments on commit e986515

Please sign in to comment.