Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.yml #1

Open
wants to merge 1 commit into
base: root
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 38 additions & 168 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
name: Build

on:
workflow_dispatch:
push:
branches:
- '*'
Expand All @@ -28,18 +29,14 @@ jobs:
matrix:
runner: [ "windows-2022" ]
name: [ "Windows" ]
compiler: [ "MSVC", "Clang" ]
compiler: [ "MSVC"]
qt: [ 6 ]
include:
- compiler: "MSVC"
package_name: "windows"
CMAKE_SYSTEM_VERSION: "10.0.20348.0"
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM: "x64"
- compiler: "Clang"
CMAKE_SYSTEM_VERSION: "10.0.20348.0"
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_TOOLSET: "ClangCL"
CMAKE_GENERATOR_PLATFORM: "x64"
runs-on: "${{ matrix.runner }}"
name: "${{ matrix.name }} (${{ matrix.compiler }})"
env:
Expand Down Expand Up @@ -152,6 +149,9 @@ jobs:
-B "${{ github.workspace }}/build/ci" \
-DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/ci/install" \
-DPACKAGE_NAME="streamfx-${{ matrix.package_name }}" \
-DPACKAGE_PREFIX="${{ github.workspace }}/build/package" \
-Dlibobs_DIR="${{ github.workspace }}/build/obs/install" \
-DQt${{ matrix.qt }}_DIR="${{ github.workspace }}/build/qt" \
-DFFmpeg_DIR="${{ github.workspace }}/build/obsdeps" \
Expand All @@ -168,8 +168,21 @@ jobs:
env:
CMAKE_BUILD_TYPE: "RelWithDebInfo"
run: |
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target StreamFX

cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target install
- name: "Packaging: Install InnoSetup"
if: startsWith( matrix.runner, 'windows' )
run: |
curl "-kL" "https://www.dropbox.com/scl/fi/sda9ecx9qzqiaq8ifryi1/innosetup-6.2.1.exe?rlkey=5jf07t109j34dppvmuen36271&dl=1" "-f" "--retry" "5" "-o" "inno.exe"
.\inno.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
- name: "Packaging"
shell: cmd
run: |
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 ".\build\ci\installer.iss"
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
name: "${{ matrix.runner }}-${{ matrix.compiler }}-qt${{ matrix.qt }}"
path: "${{ github.workspace }}/build/package"
macos:
strategy:
fail-fast: false
Expand All @@ -180,6 +193,7 @@ jobs:
include:
- compiler: "Clang"
name: "MacOS"
package_name: "macos"
CMAKE_GENERATOR: "Xcode"
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
CMAKE_OSX_ARCHITECTURES: "x86_64;arm64"
Expand Down Expand Up @@ -292,6 +306,9 @@ jobs:
-S "${{ github.workspace }}" \
-B "${{ github.workspace }}/build/ci" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/ci/install" \
-DPACKAGE_NAME="streamfx-${{ matrix.package_name }}" \
-DPACKAGE_PREFIX="${{ github.workspace }}/build/package" \
-Dlibobs_DIR="${{ github.workspace }}/build/obs/install" \
-DQt${{ matrix.qt }}_DIR="${{ github.workspace }}/build/qt" \
-DFFmpeg_DIR="${{ github.workspace }}/build/obsdeps" \
Expand All @@ -306,168 +323,21 @@ jobs:
env:
CMAKE_BUILD_TYPE: "RelWithDebInfo"
run: |
cmake --build "build/ci" --config RelWithDebInfo --target StreamFX

ubuntu:
strategy:
fail-fast: false
matrix:
runner: [ "ubuntu-22.04", "ubuntu-20.04" ]
compiler: [ "GCC-12", "GCC-11", "Clang-16" ]
qt: [ 5, 6 ]
CMAKE_GENERATOR: [ "Ninja Multi-Config" ]
exclude:
- runner: "ubuntu-22.04"
qt: 5
- runner: "ubuntu-22.04"
compiler: "GCC-11"
- runner: "ubuntu-20.04"
qt: 6
- runner: "ubuntu-20.04"
compiler: "GCC-12"
include:
- runner: "ubuntu-22.04"
name: "Ubuntu 22.04"
- runner: "ubuntu-20.04"
name: "Ubuntu 20.04"
runs-on: "${{ matrix.runner }}"
name: "${{ matrix.name }} (${{ matrix.compiler }}, Qt${{ matrix.qt }})"
env:
CMAKE_GENERATOR: "${{ matrix.CMAKE_GENERATOR }}"
CMAKE_GENERATOR_PLATFORM: "${{ matrix.CMAKE_GENERATOR_PLATFORM }}"
CMAKE_GENERATOR_TOOLSET: "${{ matrix.CMAKE_GENERATOR_TOOLSET }}"
CMAKE_SYSTEM_VERSION: "${{ matrix.CMAKE_SYSTEM_VERSION }}"
steps:
- name: "Clone"
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: "Install Build Tools"
shell: bash
run: |
echo "Installing essential tools..."
sudo apt-get -qq update
sudo apt-get install build-essential checkinstall pkg-config cmake ninja-build git

# Install the appropriate compiler
IFS=$'-' compiler=($(echo "${{ matrix.compiler }}")) # ToDo: Can this be done without invoking a sub-shell?
echo "Installing '${compiler[0]}' version ${compiler[1]}..."
if [[ "${compiler[0]}" == "GCC" ]]; then
sudo apt-get install binutils gcc-${compiler[1]} g++-${compiler[1]}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${compiler[1]} 800 --slave /usr/bin/g++ g++ /usr/bin/g++-${compiler[1]}

echo "CMAKE_C_COMPILER=gcc-${compiler[1]}" >> "$GITHUB_ENV"
echo "CMAKE_CXX_COMPILER=g++-${compiler[1]}" >> "$GITHUB_ENV"
elif [[ "${compiler[0]}" == "Clang" ]]; then
curl -jLo /tmp/llvm.sh "https://apt.llvm.org/llvm.sh"
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh ${compiler[1]} all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${compiler[1]} 800
sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-${compiler[1]} 800
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${compiler[1]} 800
sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-${compiler[1]} 800
sudo update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${compiler[1]} 800
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${compiler[1]} 800
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${compiler[1]} 800

echo "CMAKE_C_COMPILER=clang-${compiler[1]}" >> "$GITHUB_ENV"
echo "CMAKE_CXX_COMPILER=clang++-${compiler[1]}" >> "$GITHUB_ENV"
else
echo "Unknown Compiler"
exit 1
fi
- name: "Dependency: Qt"
id: qt
cmake --build "build/ci" --config RelWithDebInfo --target install
- name: 'Packaging: Install Packages'
if: startsWith( matrix.runner, 'macos' )
shell: bash
run: |
if [[ ${{ matrix.qt }} -eq 5 ]]; then
sudo apt-get -y install -V \
qtbase5-dev qtbase5-private-dev libqt5svg5-dev
elif [[ ${{ matrix.qt }} -eq 6 ]]; then
sudo apt-get -y install -V \
qt6-base-dev qt6-base-private-dev libqt6svg6-dev libgles2-mesa-dev libegl1-mesa-dev libgl1-mesa-dev
fi
- name: "Dependency: Prebuilt OBS Studio Dependencies"
id: obsdeps
curl -kL "https://www.dropbox.com/scl/fi/fbal90nds32qx5khn8b0c/Packages-1.2.10.dmg?rlkey=a9xr4md58ro7278ioqd1k52w8&dl=1" -f --retry 5 -o "Packages.dmg"
sudo hdiutil attach ./Packages.dmg
pushd /Volumes/Packages*
sudo installer -pkg ./Install\ Packages.pkg -target /
- name: "Packaging"
shell: bash
run: |
sudo apt-get -y install -V \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
libcurl4-openssl-dev
- name: "Dependency: OBS Libraries (Cache)"
id: obs-cache
uses: actions/cache@v3
packagesbuild "${{ github.workspace }}/build/ci/installer.pkgproj"
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
path: "${{ github.workspace }}/build/obs"
key: "obs${{ env.obs_version }}-${{ matrix.runner }}_${{ matrix.compiler }}--${{ matrix.runner }}-${{ matrix.compiler }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: OBS Libraries"
id: obs
if: ${{ steps.obs-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
# Apply patches to obs-studio
pushd "${{ github.workspace }}/third-party/obs-studio" > /dev/null
for f in ../../patches/obs-studio/*.patch; do
echo "Applying patch '${f}''..."
[ -e "$f" ] || continue
git apply "$f"
done
popd > /dev/null

# Extra requirements by libobs on Linux.
sudo apt-get install \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
libx264-dev libcurl4-openssl-dev libmbedtls-dev libgl1-mesa-dev libjansson-dev libluajit-5.1-dev python3-dev \
libx11-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-xinerama0-dev libxcomposite-dev libxinerama-dev \
libxcb1-dev libx11-xcb-dev libxcb-xfixes0-dev swig libcmocka-dev libxss-dev libglvnd-dev libgles2-mesa \
libgles2-mesa-dev libwayland-dev \
libasound2-dev libfdk-aac-dev libfontconfig-dev libfreetype6-dev libjack-jackd2-dev libpulse-dev \
libsndio-dev libspeexdsp-dev libudev-dev libv4l-dev libva-dev libvlc-dev libdrm-dev

# Build obs-studio
cmake \
-S "${{ github.workspace }}/third-party/obs-studio" \
-B "${{ github.workspace }}/build/obs" \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_C_COMPILER="${{ env.CMAKE_C_COMPILER }}" \
-DCMAKE_CXX_COMPILER="${{ env.CMAKE_CXX_COMPILER }}" \
-DCMAKE_C_FLAGS="${{ env.CMAKE_C_FLAGS }}" \
-DCMAKE_CXX_FLAGS="${{ env.CMAKE_CXX_FLAGS }}" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/obs/install" \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/build/obsdeps;${{ github.workspace }}/build/qt" \
-DENABLE_PLUGINS=OFF \
-DENABLE_UI=OFF \
-DENABLE_SCRIPTING=OFF
cmake \
--build "${{ github.workspace }}/build/obs" \
--config Release \
--target obs-frontend-api
cmake \
--install "${{ github.workspace }}/build/obs" \
--config Release \
--component obs_libraries
- name: "Configure"
continue-on-error: true
shell: bash
run: |
cmake \
-S "${{ github.workspace }}" \
-B "${{ github.workspace }}/build/ci" \
-DCMAKE_C_COMPILER="${{ env.CMAKE_C_COMPILER }}" \
-DCMAKE_CXX_COMPILER="${{ env.CMAKE_CXX_COMPILER }}" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/ci/install" \
-DPACKAGE_NAME="streamfx-${{ env.PACKAGE_NAME }}" \
-DPACKAGE_PREFIX="${{ github.workspace }}/build/package" \
-Dlibobs_DIR="${{ github.workspace }}/build/obs/install"
- name: "Build: Debug"
continue-on-error: true
shell: bash
run: |
cmake --build "build/ci" --config Debug --target StreamFX
- name: "Build: Release"
shell: bash
run: |
cmake --build "build/ci" --config RelWithDebInfo --target StreamFX
name: "${{ matrix.runner }}-${{ matrix.compiler }}-qt${{ matrix.qt }}"
path: "${{ github.workspace }}/build/package"