| 1 |
name: Build |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
paths: |
| 6 |
- .github/workflows/main.yml |
| 7 |
- 'src/**' |
| 8 |
- 'cmake/**' |
| 9 |
- 'CMakeLists.txt' |
| 10 |
tags: |
| 11 |
- '*' |
| 12 |
branches: |
| 13 |
- '**' |
| 14 |
|
| 15 |
jobs: |
| 16 |
build-plugin: |
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
obs-version: ['28.0.0', '30.2.0'] |
| 20 |
name: 'Build Plugin' |
| 21 |
runs-on: ubuntu-latest |
| 22 |
steps: |
| 23 |
- name: Restore OBS from cache |
| 24 |
uses: actions/cache@v4 |
| 25 |
id: cache-obs |
| 26 |
with: |
| 27 |
path: ${{ github.workspace }}/obs/ |
| 28 |
key: ${{ matrix.obs-version }} |
| 29 |
- name: Checkout OBS |
| 30 |
if: steps.cache-obs.outputs.cache-hit != 'true' |
| 31 |
uses: actions/checkout@v4 |
| 32 |
with: |
| 33 |
repository: 'obsproject/obs-studio' |
| 34 |
path: 'obs-src' |
| 35 |
ref: ${{ matrix.obs-version }} |
| 36 |
submodules: 'recursive' |
| 37 |
- name: 'Install system dependencies' |
| 38 |
run: | |
| 39 |
sudo apt update |
| 40 |
sudo apt install cmake ninja-build pkg-config clang clang-format build-essential curl ccache git zsh\ |
| 41 |
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev\ |
| 42 |
libcurl4-openssl-dev\ |
| 43 |
libxcb1-dev libx11-xcb-dev\ |
| 44 |
libgl1-mesa-dev\ |
| 45 |
libglvnd-dev\ |
| 46 |
libgles2-mesa\ |
| 47 |
libgles2-mesa-dev\ |
| 48 |
libpipewire-0.3-dev\ |
| 49 |
uthash-dev libjansson-dev |
| 50 |
- name: 'Configure OBS' |
| 51 |
if: steps.cache-obs.outputs.cache-hit != 'true' |
| 52 |
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 |
| 53 |
- name: 'Build OBS' |
| 54 |
if: steps.cache-obs.outputs.cache-hit != 'true' |
| 55 |
run: cmake --build obs-src/build -j4 |
| 56 |
- name: 'Install OBS' |
| 57 |
if: steps.cache-obs.outputs.cache-hit != 'true' |
| 58 |
run: cmake --install obs-src/build --prefix obs |
| 59 |
- name: 'Checkout' |
| 60 |
uses: actions/checkout@v4 |
| 61 |
with: |
| 62 |
path: 'plugin' |
| 63 |
- name: 'Configure' |
| 64 |
run: cmake -B ./plugin/build -S ./plugin -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dlibobs_DIR="$GITHUB_WORKSPACE/obs/lib/cmake/libobs/" |
| 65 |
- name: 'Build' |
| 66 |
run: cmake --build ./plugin/build -j4 |
| 67 |
- name: 'Package' |
| 68 |
run: | |
| 69 |
mkdir -p ./linux-pipewire-audio/bin/64bit |
| 70 |
cp ./plugin/build/linux-pipewire-audio.so ./linux-pipewire-audio/bin/64bit/linux-pipewire-audio.so |
| 71 |
cp -r ./plugin/data/ ./linux-pipewire-audio/data/ |
| 72 |
tar -zcvf linux-pipewire-audio-$OBS_VERSION.tar.gz linux-pipewire-audio |
| 73 |
env: |
| 74 |
OBS_VERSION: ${{ matrix.obs-version }} |
| 75 |
- name: 'Upload' |
| 76 |
uses: actions/upload-artifact@v4 |
| 77 |
with: |
| 78 |
path: linux-pipewire-audio-${{ matrix.obs-version }}.tar.gz |
| 79 |
name: linux-pipewire-audio-${{ matrix.obs-version }} |