[ci] macos fix #33
Workflow file for this run
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_headless_packages | |
on: | |
push: | |
branch-ignore: | |
- '*' | |
tags: | |
- 'v?\d+.\d+.\d+-headless' | |
- 'headless*' | |
jobs: | |
# ------ # | |
# Ubuntu # | |
# ------ # | |
build-ubuntu: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04] | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout TTK-ParaView source code | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt update | |
# TTK-ParaView dependencies | |
sudo apt install -y \ | |
g++ \ | |
libosmesa-dev \ | |
libopenmpi-dev \ | |
ninja-build \ | |
dpkg-dev | |
- name: Create & configure ParaView build directory | |
run: | | |
mkdir build && cd build | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=/usr \ | |
-DPARAVIEW_PYTHON_SITE_PACKAGES_SUFFIX=lib/python3/dist-packages \ | |
-DPARAVIEW_USE_MPI=ON \ | |
-DPARAVIEW_USE_QT=OFF \ | |
-DVTK_USE_X=OFF \ | |
-DVTK_OPENGL_HAS_OSMESA=ON \ | |
-DTTK_PARAVIEW_HEADLESS_DEPS=ON \ | |
-GNinja \ | |
$GITHUB_WORKSPACE | |
- name: Build ParaView | |
run: | | |
cd build | |
cmake --build . --parallel | |
- name: Create ParaView package | |
run: | | |
cd build | |
cpack -G DEB | |
- name: Upload Debian package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ttk-paraview-headless-${{ matrix.os }} | |
path: build/ttk-paraview.deb | |
# ----- # | |
# macOS # | |
# ----- # | |
build-macos: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-12, macos-14] | |
env: | |
CCACHE_DIR: /Users/runner/work/ttk/.ccache | |
CCACHE_MAXSIZE: 200M | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout TTK-ParaView source code | |
- name: Remove hosted Python | |
run: | | |
sudo rm -rf /Library/Frameworks/Python.framework/ | |
sudo rm -rf /usr/local/Frameworks/Python.framework/ | |
- name: Install macOS dependencies | |
run: | | |
# ParaView dependencies | |
brew reinstall python | |
brew install --cask xquartz | |
brew install ninja open-mpi | |
- name: Create & configure ParaView build directory | |
run: | | |
mkdir build && cd build | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DPARAVIEW_USE_MPI=ON \ | |
-DPARAVIEW_USE_QT=OFF \ | |
-GNinja \ | |
$GITHUB_WORKSPACE | |
- name: Build ParaView | |
run: | | |
cd build | |
cmake --build . --parallel | |
- name: Create ParaView package | |
run: | | |
cd build | |
cpack -G TGZ | |
- name: Upload compressed binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ttk-paraview-headless-${{ matrix.os }} | |
path: build/ttk-paraview.tar.gz | |
# ------- # | |
# Windows # | |
# ------- # | |
build-windows: | |
runs-on: windows-2022 | |
env: | |
CONDA_ROOT: C:\Miniconda | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout TTK-ParaView source code | |
- uses: s-weigand/setup-conda@v1 | |
- name: Install dependencies with conda | |
shell: bash | |
run: | | |
conda install -c conda-forge glew python=3.10 | |
- name: Remove hosted Python | |
shell: bash | |
run: | | |
rm -rf C:/hostedtoolcache/windows/Python | |
- name: Create & configure ParaView build directory | |
shell: cmd | |
run: | | |
cd .. | |
mkdir b | |
cd b | |
cmake ^ | |
-DPARAVIEW_USE_QT=OFF ^ | |
-DPython3_ROOT_DIR="%CONDA_ROOT%" ^ | |
-DCMAKE_AUTOUIC=OFF ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DVTKm_MODULE_ENABLE_vtkm_filter_scalar_topology=NO ^ | |
-G"Visual Studio 17 2022" ^ | |
%GITHUB_WORKSPACE% | |
- name: Build ParaView | |
shell: cmd | |
run: | | |
cd ..\b | |
cmake --build . --config Release --parallel | |
- name: Create ParaView package | |
shell: bash | |
run: | | |
cd ../b | |
cpack -G NSIS64 | |
mv ttk-paraview.exe $GITHUB_WORKSPACE | |
- name: Upload install executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ttk-paraview-headless-windows-2022 | |
path: ttk-paraview.exe | |
# --------------------- # | |
# Upload release assets # | |
# --------------------- # | |
create-release: | |
runs-on: ubuntu-latest | |
needs: [build-ubuntu, build-macos, build-windows] | |
steps: | |
- name: Delete previous release | |
uses: actions/github-script@v6 | |
continue-on-error: true | |
with: | |
script: | | |
const { owner, repo } = context.repo | |
const { data: { id } } = await github.rest.repos.getReleaseByTag({ | |
owner, | |
repo, | |
tag: "${{ github.ref_name }}" | |
}) | |
await github.rest.repos.deleteRelease({ owner, repo, release_id: id }) | |
- name: Create Release | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { owner, repo } = context.repo | |
await github.rest.repos.createRelease({ | |
owner, | |
repo, | |
tag_name: "${{ github.ref_name }}", | |
name: "Release ${{ github.ref_name }}", | |
draft: false, | |
prerelease: true | |
}) | |
- name: Fetch all uploaded artifacts | |
uses: actions/download-artifact@v3 | |
- name: Upload Ubuntu Focal .deb as Release Asset | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ttk-paraview-headless-ubuntu-20.04/ttk-paraview.deb | |
asset_name: ttk-paraview-headless-ubuntu-20.04.deb | |
- name: Upload Ubuntu Jammy .deb as Release Asset | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ttk-paraview-headless-ubuntu-22.04/ttk-paraview.deb | |
asset_name: ttk-paraview-headless-ubuntu-22.04.deb | |
- name: Upload MacOS 12 .tar.gz as Release Asset | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ttk-paraview-headless-macos-12/ttk-paraview.tar.gz | |
asset_name: ttk-paraview-headless-macos-12.tar.gz | |
- name: Upload MacOS 14 (arm64) .tar.gz as Release Asset | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ttk-paraview-headless-macos-14/ttk-paraview.tar.gz | |
asset_name: ttk-paraview-headless-macos-14-arm64.tar.gz | |
- name: Upload .exe as Release Asset | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ttk-paraview-headless-windows-2022/ttk-paraview.exe | |
asset_name: ttk-paraview-headless.exe | |
- name: Delete package artifacts | |
uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: | | |
ttk-paraview-headless* |