Skip to content

Commit

Permalink
Test both OBS 28 and 30.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dimtpap committed Jul 14, 2024
1 parent c8661a4 commit 3230fd9
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 52 deletions.
80 changes: 80 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: 'Build'
description: 'Builds OBS and the plugin'
inputs:
obs-version:
description: 'OBS Studio version'
required: true
additional-deps:
description: 'Extra system dependencies to install'
required: false
default: ''
additional-obs-cmake-flags:
description: 'Extra flags to pass to CMake when building OBS'
required: false
default: ''
plugin-output-path:
description: 'Path where the archive containing the built plugin will be saved'
required: true
outputs:
random-number:
description: "Random number"
value: ${{ steps.random-number-generator.outputs.random-number }}
runs:
using: "composite"
steps:
- name: Restore OBS from cache
uses: actions/cache@v4
id: cache-obs
with:
path: ${{ github.workspace }}/obs/
key: ${{ inputs.obs-version }}
- name: Checkout OBS
if: steps.cache-obs.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'obsproject/obs-studio'
path: 'obs-src'
ref: ${{ inputs.obs-version }}
submodules: 'recursive'
- name: 'Install system dependencies'
run: |
sudo apt update
sudo apt install cmake ninja-build pkg-config clang clang-format build-essential curl ccache git zsh\
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev\
libcurl4-openssl-dev\
libxcb1-dev libx11-xcb-dev\
libgl1-mesa-dev\
libglvnd-dev\
libgles2-mesa\
libgles2-mesa-dev\
libpipewire-0.3-dev\
$ADDITIONAL_DEPS
env:
ADDITIONAL_DEPS: ${{ inputs.additional-deps }}
- name: 'Configure OBS'
if: steps.cache-obs.outputs.cache-hit != 'true'
run: cmake -B obs-src/build -S obs-src $ADDITIONAL_OBS_CMAKE_FLAGS -DENABLE_BROWSER=OFF -DENABLE_UI=OFF -DENABLE_SCRIPTING=OFF -DENABLE_PULSEAUDIO=OFF -DENABLE_WAYLAND=OFF -DENABLE_PLUGINS=OFF
env:
ADDITIONAL_OBS_CMAKE_FLAGS: ${{ inputs.additional-obs-cmake-flags }}
- name: 'Build OBS'
if: steps.cache-obs.outputs.cache-hit != 'true'
run: cmake --build obs-src/build -j4
- name: 'Install OBS'
if: steps.cache-obs.outputs.cache-hit != 'true'
run: cmake --install obs-src/build --prefix obs
- name: 'Checkout'
uses: actions/checkout@v4
with:
path: 'plugin'
- name: 'Configure'
run: cmake -B ./plugin/build -S ./plugin -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dlibobs_DIR="$GITHUB_WORKSPACE/obs/lib/cmake/libobs/"
- name: 'Build'
run: cmake --build ./plugin/build -j4
- name: 'Package'
run: |
mkdir -p linux-pipewire-audio/bin/64bit linux-pipewire-audio/data/locale
cp ./plugin/build/linux-pipewire-audio.so ./linux-pipewire-audio/bin/64bit/linux-pipewire-audio.so
cp ./plugin/data/locale/en-US.ini ./linux-pipewire-audio/data/locale/en-US.ini
tar -zcvf $PLUGIN_OUTPUT_PATH linux-pipewire-audio
env:
PLUGIN_OUTPUT_PATH: ${{ inputs.plugin-output-path }}
67 changes: 16 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,63 +13,28 @@ on:
- '**'

jobs:
Build:
name: 'Build'
build-plugin-versions:
name: 'Build Plugin Versions'
runs-on: ubuntu-latest

steps:
- name: Restore OBS from cache
uses: actions/cache@v4
id: cache-obs
- name: Build for OBS >= 28
uses: ./.github/actions/build
with:
path: ${{ github.workspace }}/obs/
key: '30.2.0'
- name: Checkout OBS
if: steps.cache-obs.outputs.cache-hit != 'true'
uses: actions/checkout@v4
obs-version: '28.0.0'
plugin-output-path: 'linux-pipewire-audio-obs28.tar.gz'
- name: 'Upload'
uses: actions/upload-artifact@v4
with:
repository: 'obsproject/obs-studio'
path: 'obs-src'
ref: '30.2.0'
submodules: 'recursive'
- name: 'Install system dependencies'
run: |
sudo apt update
sudo apt install cmake ninja-build pkg-config clang clang-format build-essential curl ccache git zsh\
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev\
libcurl4-openssl-dev\
libxcb1-dev libx11-xcb-dev\
libgl1-mesa-dev\
libglvnd-dev\
libgles2-mesa\
libgles2-mesa-dev\
libpipewire-0.3-dev\
uthash-dev\
libjansson-dev\
- name: 'Configure OBS'
if: steps.cache-obs.outputs.cache-hit != 'true'
run: cmake -B obs-src/build -S obs-src -DOBS_CMAKE_VERSION=3 -DENABLE_BROWSER=OFF -DENABLE_UI=OFF -DENABLE_SCRIPTING=OFF -DENABLE_PULSEAUDIO=OFF -DENABLE_WAYLAND=OFF -DENABLE_PLUGINS=OFF
- name: 'Build OBS'
if: steps.cache-obs.outputs.cache-hit != 'true'
run: cmake --build obs-src/build -j4
- name: 'Install OBS'
if: steps.cache-obs.outputs.cache-hit != 'true'
run: cmake --install obs-src/build --prefix obs
- name: 'Checkout'
uses: actions/checkout@v4
path: linux-pipewire-audio-obs28.tar.gz
- name: Build for OBS >= 30.2
uses: ./.github/actions/build
with:
path: 'plugin'
- name: 'Configure'
run: cmake -B ./plugin/build -S ./plugin -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dlibobs_DIR="$GITHUB_WORKSPACE/obs/lib/cmake/libobs/"
- name: 'Build'
run: cmake --build ./plugin/build -j4
- name: 'Package'
run: |
mkdir -p linux-pipewire-audio/bin/64bit linux-pipewire-audio/data/locale
cp ./plugin/build/linux-pipewire-audio.so ./linux-pipewire-audio/bin/64bit/linux-pipewire-audio.so
cp ./plugin/data/locale/en-US.ini ./linux-pipewire-audio/data/locale/en-US.ini
tar -zcvf linux-pipewire-audio.tar.gz linux-pipewire-audio
obs-version: '30.2.0'
additional-deps: 'uthash-dev libjansson-dev'
additional-obs-cmake-flags: '-DOBS_CMAKE_VERSION=3'
plugin-output-path: 'linux-pipewire-audio-obs30-2.tar.gz'
- name: 'Upload'
uses: actions/upload-artifact@v4
with:
path: linux-pipewire-audio.tar.gz
path: linux-pipewire-audio-obs30-2.tar.gz
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
build
/build

.vscode

0 comments on commit 3230fd9

Please sign in to comment.