diff --git a/.gitea/scripts/publish-release.sh b/.gitea/scripts/publish-release.sh index 19a8e44..4fdeaa3 100755 --- a/.gitea/scripts/publish-release.sh +++ b/.gitea/scripts/publish-release.sh @@ -26,8 +26,27 @@ MACOS_BUNDLE_FOUND="${MACOS_BUNDLE_FOUND:-false}" if [ "${MACOS_BUNDLE_FOUND}" = "true" ]; then MACOS_NOTE="This archive contains a \`.plugin\` bundle." + MACOS_INSTALL_HEADING="### macOS (installation path not yet verified in real OBS)" + MACOS_INSTALL_BODY="OBS on macOS loads plugins as \`.plugin\` bundles under +\`~/Library/Application Support/obs-studio/plugins/\`. This archive already +has that shape at its top level -- extract it straight there: + +\`\`\` +unzip streamer-tools-camera-${TAG}-macos.zip \\ + -d ~/Library/Application\\ Support/obs-studio/plugins/ +\`\`\` + +No manual copying required. This has not been confirmed against a real OBS +install on macOS -- report back if you try it." else MACOS_NOTE="This archive is packaged as a bare \`streamer-tools-camera.so\` (the layout \`build/package/\` currently produces on macOS), **not** an OBS.app-loadable \`.plugin\` bundle. It will not load in the OBS GUI as-is." + MACOS_INSTALL_HEADING="### macOS (installation path not yet verified in real OBS; packaging gap)" + MACOS_INSTALL_BODY="OBS on macOS loads plugins as \`.plugin\` bundles under +\`~/Library/Application Support/obs-studio/plugins/\`. As of this release, +this project's \`build/package/\` output on macOS is **not yet that bundle +shape** -- see the \"macOS packaging gap\" section of \`README.md\`. Treat the +macOS archive here as a build-verification artifact, not a working +drop-in, until that gap is closed." fi NOTES_FILE="$(mktemp)" @@ -71,39 +90,41 @@ watching OBS. ## Installing +Every archive is now shaped as a straight drop-in for its platform's OBS +plugins directory -- extract it directly there, no manual copying of +subfolders required. + ### Linux \`\`\` -mkdir -p ~/.config/obs-studio/plugins/streamer-tools-camera -unzip streamer-tools-camera-${TAG}-linux-x64.zip -d /tmp/stplugin-camera -cp -r /tmp/stplugin-camera/bin /tmp/stplugin-camera/data \\ - ~/.config/obs-studio/plugins/streamer-tools-camera/ +mkdir -p ~/.config/obs-studio/plugins +unzip streamer-tools-camera-${TAG}-linux-x64.zip -d ~/.config/obs-studio/plugins/ \`\`\` Start OBS, then Sources -> \`+\` -> "streamer-tools Camera" -> fill in the server URL, room slug and read key from the room's settings page -> -"Refresh camera list" -> pick a camera. This is the same drop-in layout -README's "Testing this by hand" documents for a source build, adapted for a -downloaded zip -- known-good on Linux. +"Refresh camera list" -> pick a camera. Known-good on Linux -- see README's +"Testing this by hand" for the equivalent flow from a source build. ### Windows (installation path not yet verified in real OBS) Per \`AddExtraModulePaths()\` in obs-studio's \`UI/window-basic-main.cpp\`, OBS -on Windows searches a plugins directory for \`bin\\64bit\\.dll\` plus a -sibling \`data\\\`. Unzip the archive and copy its \`bin\\\` and \`data\\\` into -your OBS plugins directory (typically -\`%APPDATA%\\obs-studio\\plugins\\streamer-tools-camera\\\`), matching the -Linux layout above. This has not been confirmed against a real OBS install on -Windows -- report back if you try it. +on Windows searches \`%APPDATA%\\obs-studio\\plugins\\\\\` for +\`bin\\64bit\\.dll\` plus a sibling \`data\\\`. This archive already has +that \`\\bin\\...\`/\`\\data\\...\` shape at its top level -- +extract it straight into the plugins folder: -### macOS (installation path not yet verified in real OBS; packaging gap) +\`\`\` +Expand-Archive streamer-tools-camera-${TAG}-windows-x64.zip \` + -DestinationPath \$env:APPDATA\\obs-studio\\plugins\\ +\`\`\` -OBS on macOS loads plugins as \`.plugin\` bundles under -\`~/Library/Application Support/obs-studio/plugins/\`. As of this release, -this project's \`build/package/\` output on macOS is **not yet that bundle -shape** -- see the "macOS packaging gap" section of \`README.md\`. Treat the -macOS archive here as a build-verification artifact, not a working -drop-in, until that gap is closed. +This has not been confirmed against a real OBS install on Windows -- report +back if you try it. + +${MACOS_INSTALL_HEADING} + +${MACOS_INSTALL_BODY} ## What this is diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index cb66b3f..34fe165 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -55,7 +55,19 @@ jobs: command -v zip >/dev/null || sudo apt-get install -y -qq zip out="streamer-tools-camera-${GITEA_REF_NAME}-linux-x64.zip" root="$(pwd)" - ( cd build/package && zip -r "${root}/${out}" . ) + + # Wrap build/package/'s bin/+data/ inside a top-level + # streamer-tools-camera/ directory, matching the plugin directory + # name OBS itself expects under /obs-studio/plugins/ (see + # obs-adapter/CMakeLists.txt's staging comment). This makes the + # archive a straight `unzip -d ~/.config/obs-studio/plugins/` + # drop-in -- no manual `cp -r bin data` step required. + stage="$(mktemp -d)" + mkdir -p "${stage}/streamer-tools-camera" + cp -r build/package/. "${stage}/streamer-tools-camera/" + ( cd "${stage}" && zip -r "${root}/${out}" streamer-tools-camera ) + rm -rf "${stage}" + mkdir -p dist mv "${out}" "dist/${out}" ls -la dist @@ -91,13 +103,18 @@ jobs: root="$(pwd)" mkdir -p dist - # macOS packaging is being fixed separately (see the "macOS - # packaging gap" in README.md). Once it lands, build/package/ (or - # wherever that work stages its output) should contain a - # `.plugin` bundle directory -- look for one rather than - # assuming its exact final location, and fall back to packaging - # build/package/ as-is (today's actual, non-bundle output) if none - # is found yet. + # Look for a *.plugin bundle rather than assuming its exact final + # location, falling back to packaging build/package/ as-is (a + # bare .so, not a loadable bundle) only if the bundle step didn't + # run or produced nothing -- see the macOS packaging gap in + # README.md for when that fallback path is actually live. The + # bundle itself is zipped at the archive's top level (cd into its + # parent, zip just the bundle dir) so the archive is already a + # straight `unzip -d ~/Library/Application\ Support/obs-studio/ + # plugins/` drop-in -- no wrapping needed here, unlike + # Linux/Windows above, because OBS wants the whole *.plugin + # bundle directly under plugins/, not nested under a named + # subdirectory. bundle="$(find build -maxdepth 4 -type d -name '*.plugin' 2>/dev/null | head -n1 || true)" if [ -n "${bundle}" ]; then echo "Found macOS .plugin bundle: ${bundle}" @@ -143,7 +160,23 @@ jobs: $ErrorActionPreference = "Stop" $out = "streamer-tools-camera-$env:GITEA_REF_NAME-windows-x64.zip" New-Item -ItemType Directory -Force -Path dist | Out-Null - Compress-Archive -Path build\package\* -DestinationPath "dist\$out" -Force + + # Wrap build\package\'s bin\+data\ inside a top-level + # streamer-tools-camera\ directory, matching the plugin directory + # name OBS itself expects under %APPDATA%\obs-studio\plugins\ (see + # obs-adapter/CMakeLists.txt's staging comment). This makes the + # archive a straight `Expand-Archive -DestinationPath + # $env:APPDATA\obs-studio\plugins\` drop-in -- no manual copy step + # required. Compress-Archive includes the source folder's own name + # as the archive root when given a single directory path, so + # staging under a streamer-tools-camera\ dir is enough on its own. + $stage = Join-Path $env:TEMP "stplugin-stage-$([guid]::NewGuid())" + $pluginDir = Join-Path $stage "streamer-tools-camera" + New-Item -ItemType Directory -Force -Path $pluginDir | Out-Null + Copy-Item -Path build\package\* -Destination $pluginDir -Recurse + Compress-Archive -Path $pluginDir -DestinationPath "dist\$out" -Force + Remove-Item -Recurse -Force $stage + Get-ChildItem dist env: GITEA_REF_NAME: ${{ github.ref_name }}