obs-StreamFX/.github/workflows/main.yml

268 lines
8.1 KiB
YAML

name: Build
on:
push:
branches:
- 'master'
tags:
- '*'
pull_request:
branches:
- '*'
env:
CACHE_VERSION: 1
LIBAOM_VERSION: "3.2.0.0"
jobs:
windows:
name: "Windows 64-bit"
strategy:
fail-fast: true
matrix:
runner: [ windows-2019 ]
include:
- runner: windows-2019
id: windows-2019
windows_sdk: "10.0.18362.0"
cmake_generator: "Visual Studio 16 2019"
cmake_generator_platform: "x64"
runs-on: ${{ matrix.runner }}
env:
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
CMAKE_GENERATOR_PLATFORM: ${{ matrix.cmake_generator_platform }}
CMAKE_GENERATOR_TOOLSET: "host=x64"
CMAKE_SYSTEM_VERSION: ${{ matrix.windows_sdk }}
steps:
- name: "Clone"
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: "Dependencies: Cache"
if: ${{ github.event_name != 'pull_request' }}
uses: actions/cache@v2
with:
path: |
build/temp/autodeps
key: autodeps-${{ matrix.id }}-${{ env.CACHE_VERSION }}
- name: "Code Signing"
if: ${{ github.event_name != 'pull_request' }}
id: codesign
shell: bash
run: |
# Restore the Certificate back into a file.
echo "${{ secrets.CODESIGN_CERT_WIN }}" | base64 --decode > "${{ github.workspace }}/cert.pfx"
echo "::set-output name=cmake_args::-DENABLE_CODESIGN=ON -DCODESIGN_TIMESTAMPS=ON"
- name: "StreamFX: Configure"
shell: bash
env:
CODESIGN_FILE: ${{ github.workspace }}/cert.pfx
CODESIGN_PASS: ${{ secrets.CODESIGN_CERT_WIN_PASSWORD }}
run: |
cmake -H. -B"build/temp" \
${{ steps.codesign.outputs.cmake_args }} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="build/distrib" \
-DPACKAGE_NAME="streamfx-${{ matrix.id }}" \
-DPACKAGE_PREFIX="build/package" \
-DAOM_PATH="build/libaom/"
- name: "StreamFX: Build"
shell: bash
run: |
cmake --build "build/temp" --config RelWithDebInfo --target INSTALL
- name: "StreamFX: Package (Install Prerequisites)"
run: |
curl "-kL" "https://cdn.xaymar.com/ci/innosetup-6.1.2.exe" "-f" "--retry" "5" "-o" "inno.exe"
.\inno.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
- name: "StreamFX: Package"
shell: bash
run: |
mkdir build/package
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_7Z
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_ZIP
- name: "StreamFX: Signed Installer Preparation"
if: ${{ github.event_name != 'pull_request' }}
id: codesign_install
shell: bash
run: |
if [[ -f "${{ github.workspace }}/cert.pfx" ]]; then
signtool=$(awk 'match($0, /^;signtool=(.+)$/, ary) {print ary[1]}' "${{ github.workspace }}/build/temp/installer.iss")
echo "::set-output name=iscc_signtool::${signtool}"
fi
- name: "StreamFX: Package Installer"
shell: cmd
run: |
echo '"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 "/Ssigntool=${{ steps.codesign_install.outputs.iscc_signtool }} $p" ".\build\temp\installer.iss"'
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 "/Ssigntool=${{ steps.codesign_install.outputs.iscc_signtool }} $p" ".\build\temp\installer.iss"
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.id }}
path: build/package
ubuntu:
name: "Ubuntu 64-bit"
strategy:
fail-fast: true
matrix:
ubuntu: [ focal ]
compiler: [ gcc, clang ]
include:
- ubuntu: focal
compiler: gcc
compiler-cxx: g++
runner: ubuntu-20.04
packages: gcc-9 g++9
extra_command: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 800 --slave /usr/bin/g++ g++ /usr/bin/g++-9
id: ubuntu-20.04
- ubuntu: focal
compiler: clang
compiler-cxx: clang++
runner: ubuntu-20.04
packages: ""
extra_command: 'sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"'
id: ubuntu-20.04-clang
runs-on: ${{ matrix.runner }}
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compiler-cxx }}
CMAKE_GENERATOR: "Ninja"
steps:
- name: "Clone"
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: "Prerequisites: Apt-Get"
shell: bash
run: |
sudo apt-get -qq update
sudo apt-get purge libjpeg9-dev:amd64 libjpeg8-dev:amd64 libjpeg-turbo8-dev:amd64
sudo apt-get install \
build-essential \
checkinstall \
pkg-config \
cmake \
ninja-build \
git \
${{ matrix.packages }} \
qt5-default libqwt-qt5-dev libqt5svg5-dev \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
libcurl4-openssl-dev
${{ matrix.extra_command }}
- name: "Dependencies: Cache"
if: ${{ github.event_name != 'pull_request' }}
uses: actions/cache@v2
with:
path: |
build/temp/autodeps
key: autodeps-${{ matrix.id }}-${{ env.CACHE_VERSION }}
- name: "StreamFX: Configure"
shell: bash
run: |
cmake -H. -B"build/temp" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="build/distrib" \
-DPACKAGE_NAME="streamfx-${{ matrix.id }}" \
-DPACKAGE_PREFIX="build/package"
- name: "StreamFX: Build"
shell: bash
run: |
cmake --build "build/temp" --config RelWithDebInfo --target install
- name: "StreamFX: Package"
shell: bash
run: |
mkdir build/package
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_7Z
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_ZIP
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.id }}
path: build/package
macos:
strategy:
fail-fast: true
matrix:
runner: [ macos-latest ]
include:
- runner: macos-latest
id: macos-10.15
target-version: "10.15"
name: "MacOS (${{ matrix.target-version }})"
runs-on: ${{ matrix.runner }}
env:
CMAKE_GENERATOR: "Xcode"
CMAKE_OSX_DEPLOYMENT_TARGET: "${{ matrix.target-version }}"
steps:
- name: "Clone"
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: "Dependencies: Cache"
if: ${{ github.event_name != 'pull_request' }}
uses: actions/cache@v2
with:
path: |
build/temp/autodeps
key: autodeps-${{ matrix.id }}-${{ env.CACHE_VERSION }}
- name: "StreamFX: Configure"
shell: bash
run: |
cmake -H. -B"build/temp" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="build/distrib" \
-DPACKAGE_NAME="streamfx-${{ matrix.id }}" \
-DPACKAGE_PREFIX="build/package"
- name: "StreamFX: Build"
shell: bash
run: |
cmake --build "build/temp" --config RelWithDebInfo --target install
- name: "StreamFX: Package"
shell: bash
run: |
mkdir build/package
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_7Z
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_ZIP
- name: 'Packages: Install'
shell: bash
run: |
curl -L -O http://s.sudre.free.fr/Software/files/Packages.dmg
sudo hdiutil attach ./Packages.dmg
pushd /Volumes/Packages*
sudo installer -pkg ./Install\ Packages.pkg -target /
- name: "Packages: Package"
shell: bash
run: |
packagesbuild ./build/temp/installer.pkgproj
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.id }}
path: build/package