diff --git a/.github/workflows/build-vtk.yml b/.github/workflows/build-vtk.yml index e800d11..705e8e3 100644 --- a/.github/workflows/build-vtk.yml +++ b/.github/workflows/build-vtk.yml @@ -13,55 +13,112 @@ jobs: strategy: matrix: - os: [ 'ubuntu-20.04', 'macos-11', 'macos-14', 'windows-2019' ] - # os: [ 'ubuntu-20.04', 'macos-11', 'macos-14', 'windows-2019' ] - python-version: [ '3.11' ] - # python-version: [ '3.9', '3.10', '3.11', '3.12' ] + os: [ 'ubuntu-20.04', 'macos-13', 'macos-14', 'windows-2019' ] + python-version: [ '3.9', '3.10', '3.11', '3.12' ] steps: - name: Checkout project uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 + if: ${{ runner.os != 'macOS' }} # setup-python is currently very broken for macos-14 and possibly 13 too with: python-version: ${{ matrix.python-version }} + + - name: Setup Micromamba on MacOS + if: ${{ runner.os == 'macOS' }} # setup-python is currently very broken for macos-14 and possibly 13 too + uses: mamba-org/setup-micromamba@v1 + with: + environment-name: build-vtk # required by micromamba + create-args: >- + python=${{ matrix.python-version }} - name: Setup Python Env - shell: bash -l {0} + # 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 - + python -V + python -m pip install --upgrade pip + python -m pip install --upgrade wheel + python -m pip freeze + + - name: Setup Windows build environment (MSVC) + if: ${{ runner.os == 'Windows' }} + uses: ilammy/msvc-dev-cmd@v1 + - name: Ubuntu Deps shell: bash -l {0} + if: ${{ runner.os == 'Linux' }} 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 + 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 + + # - name: MacOS-13 Deps + # shell: bash -l {0} + # if: ${{ matrix.os != 'macos-11' }} + # run: | - - name: Windows Deps + - name: MacOS Deps # 13 and 14 shell: bash -l {0} + if: ${{ runner.os == 'macOS' }} run: | - if [ "$RUNNER_OS" == "Windows" ]; then - choco install ninja - fi + brew install ninja + micromamba info + + # - name: Windows Deps + # shell: bash -l {0} #cmd? + # if: ${{ matrix.os != 'windows-2019' }} + # run: | + + - name: Build Linux Wheel from Scratch + shell: bash -l {0} + if: ${{ runner.os == 'Linux' }} + run: | + python -V + pip install --upgrade setuptools + mkdir -p ./vtk/build + curl -L -O 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 + python setup.py bdist_wheel + cd ../../ + find ./ -iname *.whl - - name: Build Wheel from Scratch + - name: Build macOS Wheel from Scratch shell: bash -l {0} + if: ${{ runner.os == 'macOS' }} run: | - pip3 install --upgrade setuptools + micromamba info + python -V + pip install --upgrade setuptools mkdir -p ./vtk/build curl -L -O 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 + python setup.py bdist_wheel cd ../../ find ./ -iname *.whl + - name: Build Windows Wheel from Scratch + shell: cmd + if: ${{ runner.os == 'Windows' }} + run: | + python -V + cl + pip install --upgrade setuptools + mkdir vtk\build + curl -L -O https://www.vtk.org/files/release/9.2/VTK-9.2.6.tar.gz + 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 + python setup.py bdist_wheel + cd ..\..\ + dir /s + - name: Upload Artifact uses: actions/upload-artifact@v4 with: