Build VTK from source #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: Build VTK from source | |
on: | |
workflow_dispatch | |
env: | |
PYTHONUTF8: 1 | |
jobs: | |
build: | |
name: Build with wrapper for Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ 'ubuntu-20.04' ] | |
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup Python Env | |
shell: bash -l {0} | |
# The `bdist_wheel` command requires the `wheel` package | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install --upgrade wheel | |
python3 -m pip freeze | |
- name: Ubuntu Deps | |
shell: bash -l {0} | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt install -y build-essential cmake mesa-common-dev mesa-utils freeglut3-dev python3-dev python3-venv git-core ninja-build cmake wget libglvnd0 libglvnd-dev | |
fi | |
- name: Build Wheel from Scratch | |
shell: bash -l {0} | |
run: | | |
mkdir -p ./vtk/build | |
wget https://www.vtk.org/files/release/9.2/VTK-9.2.6.tar.gz # Update this for newer releases of VTK | |
tar -zxf VTK-9.2.6.tar.gz --directory ./vtk/ | |
cd ./vtk/build | |
cmake -GNinja -DVTK_WHEEL_BUILD=ON -DVTK_WRAP_PYTHON=ON -DCMAKE_BUILD_TYPE=Release ../VTK-9.2.6 | |
ninja | |
python3 setup.py bdist_wheel | |
cd ../../ | |
find ./ -iname *.whl | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cadquery-vtk-${{ matrix.os }}-cp${{ matrix.python-version }} | |
path: vtk/build/dist/*.whl |