Skip to content

Commit

Permalink
Adding github action specs
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-tierny committed Sep 16, 2020
1 parent 463ecf2 commit 26d3612
Showing 1 changed file with 186 additions and 0 deletions.
186 changes: 186 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branch-ignore:
- '*'
tags:
- 'v*'
- 'dev*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-linux:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install Ubuntu dependencies
run: |
sudo apt update
# ParaView dependencies
sudo apt install -y \
qt5-default \
qttools5-dev \
qtxmlpatterns5-dev-tools \
libqt5x11extras5-dev \
libqt5svg5-dev \
dpkg-dev
- name: Build patched ParaView & create package
run: |
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DVTK_ENABLE_OSPRAY=OFF \
$GITHUB_WORKSPACE
make -j$(nproc)
cpack -G DEB
- name: Update package informations
run: |
cd build
# unpack deb package to access control file
mkdir tmp
dpkg-deb -x ttk-paraview.deb tmp
dpkg-deb --control ttk-paraview.deb tmp/DEBIAN
# modify control file, remove libgcc-s1 dependency
sed 's/libgcc-s1[^,]*, //g' -i tmp/DEBIAN/control
# build updated deb package
dpkg -b tmp ttk-paraview.deb.new
# replace old package with new
mv ttk-paraview.deb.new ttk-paraview.deb
- name: Upload .deb package
uses: actions/upload-artifact@v2
with:
name: ttk-paraview-${{ matrix.os }}.deb
path: build/ttk-paraview.deb

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- name: Install macOS dependencies
run: |
brew cask install xquartz
brew install wget python libomp mesa glew boost qt ninja
- name: Build patched ParaView & create package
run: |
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DVTK_ENABLE_OSPRAY=OFF \
-DQt5_DIR=$(brew --prefix qt)/lib/cmake/Qt5 \
-GNinja \
$GITHUB_WORKSPACE
ninja
cpack -G productbuild
- name: Upload .pgk package
uses: actions/upload-artifact@v2
with:
name: ttk-paraview.pkg
path: build/ttk-paraview.pkg

build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- uses: s-weigand/setup-conda@v1

- name: Install qt with conda
shell: bash
run: |
conda install -c anaconda qt
- name: Configure & build ParaView
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DVTK_ENABLE_OSPRAY=OFF -GNinja ..
ninja
cpack -G NSIS64
- name: Upload .exe installer
uses: actions/upload-artifact@v2
with:
name: ttk-paraview.exe
path: build/ttk-paraview.exe

create-release:
runs-on: ubuntu-latest
needs: [build-linux, build-macos, build-windows]
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Fetch all uploaded artifacts
uses: actions/download-artifact@v2

- name: Upload Ubuntu Bionic .deb as Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ttk-paraview-ubuntu-18.04.deb/ttk-paraview.deb
asset_name: ttk-paraview-ubuntu-18.04.deb
asset_content_type: application/vnd.debian.binary-package

- name: Upload Ubuntu Focal .deb as Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ttk-paraview-ubuntu-20.04.deb/ttk-paraview.deb
asset_name: ttk-paraview-ubuntu-20.04.deb
asset_content_type: application/vnd.debian.binary-package

- name: Upload .pkg as Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ttk-paraview.pkg/ttk-paraview.pkg
asset_name: ttk-paraview.pkg
asset_content_type: application/x-newton-compatible-pkg

- name: Upload .exe as Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ttk-paraview.exe/ttk-paraview.exe
asset_name: ttk-paraview.exe
asset_content_type: application/vnd.microsoft.portable-executable

0 comments on commit 26d3612

Please sign in to comment.