Skip to content

Fix opengl cmake for latest VTK #175

Fix opengl cmake for latest VTK

Fix opengl cmake for latest VTK #175

Workflow file for this run

name: Build Wheels
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
workflow_dispatch:
env:
# Only support 64-bit CPython >= 3.7
# VTK does not currently build python 3.8 arm64 wheels, so skip it too
CIBW_SKIP: "cp27-* cp35-* cp36-* cp311-* cp312-* pp* *-manylinux_i686 *-musllinux_* *-win32 cp38-macosx_arm64"
# Need to match the version used by VTK
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.10
# In the Linux docker container, install the wheel SDKs to this location
CIBW_ENVIRONMENT_LINUX: VTK_WHEEL_SDK_INSTALL_PATH=/vtk-wheel-sdk
# NOTE: cross-compilation is not currently working for us for arm64.
# We are going to turn it off and build them manually until GitHub Actions
# makes arm64 runners available.
# Build both x86_64 and arm64 (through cross-compilation) wheels on Mac
# CIBW_ARCHS_MACOS: x86_64 arm64
# VTK already fixes the rpaths, so we can skip this step for MacOS
CIBW_REPAIR_WHEEL_COMMAND_MACOS:
# On Linux, we only need auditwheel to add the tags to the wheel.
# Unfortunately, auditwheel currently requires us to repair the wheel to
# add the tags, even though we do not need to repair the wheel.
# Thus, we need to set everything up for a wheel repair (including placing
# the VTK libraries in `vtkmodules`, where they are expected to be at
# runtime), perform the wheel repair, and then remove the added libraries.
# Then the tags will have been added.
CIBW_REPAIR_WHEEL_COMMAND_LINUX: .github/scripts/linux_repair_wheel.py {wheel} {dest_dir}
# Pass these variables into the Linux docker containers
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS VTK_WHEEL_SDK_INSTALL_PATH
# Run this before every build
CIBW_BEFORE_BUILD: bash .github/scripts/cibw_before_build.sh
CIBW_TEST_COMMAND: >
pip install -r {package}/Testing/Python/requirements.txt &&
pytest {package}/Testing/Python
# Use bash by default for the run command
defaults:
run:
shell: bash
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.9'
- name: Install dependencies
run: bash .github/scripts/install.sh
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
- name: Upload skbuild if an error occurred (for debugging)
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: skbuild
path: ${{ github.workspace }}/_skbuild
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
upload_pypi:
needs: build_wheels
name: Upload wheels to PyPI
runs-on: ubuntu-latest
# upload to PyPI on every tag push
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}