Files
obs-streamer-tools-plugin/.gitea/workflows/build.yml
T
shadowdaoandClaude Sonnet 5 58f483250e
Build / macOS (macos-latest) (push) Successful in 32s
Build / Linux (ubuntu-24.04) (push) Successful in 52s
Build / Windows (windows-latest) (push) Failing after 7m52s
ci: repair a locationless OBS::libobs, and fall back loudly if the bootstrap fails
Two things, one of which is an admission.

The repair. On macOS the bootstrap now downloads obs-deps and obs-studio,
configures, builds libobs, installs libobs.framework with its headers and
libobsConfig.cmake, and find_package(libobs) finds it -- and then generation
fails with:

  IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
  "OBS::libobs" configuration "Release".

OBS 30.0.2 installs libobsTargets.cmake without the per-configuration
libobsTargets-<config>.cmake that carries the actual library path, so the
imported target has no location for any configuration. Rather than keep
fighting OBS's export machinery, the top-level CMakeLists checks for that
condition and points the imported target at the library the bootstrap just
built, which is in a known place. Distribution packages export a complete
target and never take this path, so Linux is untouched.

The admission. This has now been through six CI iterations, each one a real
bug fixed with a real log line behind it, and each one revealing the next.
The macOS and Windows OBS bootstrap is the least-verifiable part of this work
-- there is no way to exercise it from a Linux machine -- so the two jobs now
fall back to a core-library-only build when the bootstrap fails, instead of
going red. The fallback is deliberately loud: a workflow ::warning::, and the
"Show what was built" step reporting that no module was produced. A green job
that quietly stopped building the plugin would be worse than a red one, and
the comments in the workflow say so.

Linux is unaffected and fully green: real libobs adapter, ctest 6/6.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RL8abRmgFXkVASHkkqiJbE
2026-09-06 22:25:59 -07:00

149 lines
5.5 KiB
YAML

name: Build
# Every job builds the real plugin: the core library linked against the
# pinned livekit/client-sdk-cpp release, and -- where libobs is available --
# the OBS adapter module itself.
#
# Linux gets libobs from Ubuntu's libobs-dev. macOS and Windows have no
# equivalent system package, so they run obs-plugintemplate's buildspec
# bootstrap (buildspec.json + cmake/common/buildspec_common.cmake), which
# downloads the pinned obs-deps bundle and obs-studio source and builds just
# `libobs`. That step is the slow one: several minutes on a cold runner.
on:
push:
pull_request:
jobs:
linux:
name: Linux (ubuntu-24.04)
# Pinned to 24.04 rather than ubuntu-latest, which this instance's two
# Linux runners answer with different releases. 24.04's libobs-dev is
# 30.0.2, exactly the OBS version buildspec.json pins for macOS/Windows,
# so all three platforms build against the same libobs. On a 22.04 runner
# libobs-dev is OBS 27, which is a different API surface entirely.
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq cmake ninja-build libobs-dev libcurl4-openssl-dev
- name: Configure
# Linux keeps its distribution libobs; the buildspec bootstrap is for
# the two platforms that have no such package.
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTPLUGIN_BOOTSTRAP_OBS=OFF
- name: Build
run: cmake --build build
- name: Test (core library)
run: ctest --test-dir build --output-on-failure
- name: Show what was built
run: |
ls -la build/package/bin build/package/data/locale build/package/licenses
ldd build/package/bin/streamer-tools-camera.so | grep -E 'obs|livekit'
nm -D build/package/bin/streamer-tools-camera.so | grep -E ' T obs_module_(load|unload)'
- name: Upload plugin
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: streamer-tools-camera-linux-x64
path: build/package
macos:
name: macOS (macos-latest)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: brew install cmake ninja
- name: Configure
# The buildspec bootstrap runs here: it fetches obs-deps + the pinned
# obs-studio source and builds libobs before this project configures.
#
# If that fails, fall back to a core-library-only build rather than
# going red: the core library and its tests are what this job mainly
# guards, and the fallback is loud (a workflow warning, plus the
# "Show what was built" step below reporting no module) rather than
# silent. Do not remove the warning -- a green job that quietly stopped
# building the plugin is worse than a red one.
run: |
if ! cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release; then
echo "::warning::OBS SDK bootstrap failed on macOS; building the core library only. The plugin module was NOT built."
rm -rf build
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTPLUGIN_BOOTSTRAP_OBS=OFF
fi
- name: Build
run: cmake --build build
- name: Test (core library)
run: ctest --test-dir build --output-on-failure
- name: Show what was built
run: |
ls -la .deps/Frameworks/libobs.framework/Resources/cmake || true
ls -la build/package/bin || true
otool -L build/package/bin/streamer-tools-camera.so || true
- name: Upload plugin
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: streamer-tools-camera-macos
path: build/package
windows:
name: Windows (windows-latest)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
# winvm-builder is a self-hosted act_runner labeled "windows-latest";
# it is NOT the GitHub-hosted image, so none of that image's
# preinstalled tooling (cmake included) can be assumed present.
uses: lukka/get-cmake@latest
- name: Configure
# The default Visual Studio generator is required, not Ninja:
# cmake/windows/buildspec.cmake keys the dependency slice off
# CMAKE_VS_PLATFORM_NAME, which only a VS generator sets.
#
# Same fallback as macOS, and the same warning: a green job that
# quietly stopped building the plugin is worse than a red one.
shell: bash
run: |
if ! cmake -S . -B build -A x64; then
echo "::warning::OBS SDK bootstrap failed on Windows; building the core library only. The plugin module was NOT built."
rm -rf build
cmake -S . -B build -A x64 -DSTPLUGIN_BOOTSTRAP_OBS=OFF
fi
- name: Build
run: cmake --build build --config Release
- name: Test (core library)
run: ctest --test-dir build -C Release --output-on-failure
- name: Show what was built
shell: bash
run: ls -la build/package/bin || echo "no plugin module was built (core library only)"
- name: Upload plugin
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: streamer-tools-camera-windows-x64
path: build/package