Add Docker definitions for Ubuntu #49
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 Kaito Udagawa <umireon@kaito.tokyo> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Plugin CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| tags: ["*"] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| VCPKG_BINARY_SOURCES: clear;http,https://vcpkg-obs.kaito.tokyo/{name}/{version}/{sha} | |
| PLUGINBINARY_RETENTION_DAYS: "7" | |
| jobs: | |
| build-windows-x64: | |
| name: Build Plugin for Windows x64 | |
| environment: ${{ github.event_name == 'push' && 'production-windows' || 'development' }} | |
| runs-on: windows-2022 | |
| timeout-minutes: 180 | |
| permissions: | |
| contents: read | |
| env: | |
| ORT_CCACHE_DIR: ${{ github.workspace }}/.ort_ccache | |
| steps: | |
| - name: Enable Windows long path | |
| shell: pwsh | |
| run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: recursive | |
| - name: Extract plugin metadata | |
| id: metadata | |
| uses: ./.github/actions/extract-buildspec | |
| - name: Install dependencies from vcpkg (Windows x64) | |
| shell: bash | |
| run: | | |
| VCPKG_ROOT="$VCPKG_INSTALLATION_ROOT" "$VCPKG_INSTALLATION_ROOT/vcpkg" install \ | |
| --x-install-root=./.deps_vendor/vcpkg_installed \ | |
| --triplet=x64-windows-static-md-obs | |
| - name: Download dependencies | |
| shell: bash | |
| run: cmake -P ./scripts/download_deps.cmake | |
| - name: Build libobs | |
| shell: pwsh | |
| run: ./scripts/build_libobs_windows.ps1 | |
| - name: Configure (Windows x64) | |
| shell: bash | |
| run: cmake --preset windows-ci-x64 | |
| - name: Build (Windows x64) | |
| shell: bash | |
| run: cmake --build --preset windows-ci-x64 | |
| - name: Test (Windows x64) | |
| if: github.event_name == 'pull_request' | |
| shell: bash | |
| run: ctest --preset windows-ci-x64 --output-on-failure | |
| - name: Package (Windows x64) | |
| shell: pwsh | |
| run: ./scripts/package_plugin_windows.ps1 -Target x64 | |
| - name: Upload Plugin Binary | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: ${{ steps.metadata.outputs.name }}-pluginbinary-windows-x64-${{ github.run_id }} | |
| path: | | |
| release/*-windows-x64.zip | |
| release/*-windows-x64-pdb.zip | |
| if-no-files-found: error | |
| retention-days: ${{ env.PLUGINBINARY_RETENTION_DAYS }} | |
| build-macos-universal: | |
| name: Build Plugin for macOS universal | |
| environment: ${{ github.event_name == 'push' && 'production-macos' || 'development' }} | |
| runs-on: macos-15 | |
| timeout-minutes: 180 | |
| permissions: | |
| contents: read | |
| env: | |
| ORT_CCACHE_DIR: ${{ github.workspace }}/.ort_ccache | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: recursive | |
| - name: Extract plugin metadata | |
| id: metadata | |
| uses: ./.github/actions/extract-buildspec | |
| - name: Install dependencies from vcpkg (macOS arm64) | |
| shell: bash | |
| run: | | |
| VCPKG_ROOT="$VCPKG_INSTALLATION_ROOT" "$VCPKG_INSTALLATION_ROOT/vcpkg" install \ | |
| --x-install-root=./.deps_vendor/vcpkg_installed_arm64 \ | |
| --triplet=arm64-osx-obs | |
| - name: Install dependencies from vcpkg (macOS x64) | |
| shell: bash | |
| run: | | |
| VCPKG_ROOT="$VCPKG_INSTALLATION_ROOT" "$VCPKG_INSTALLATION_ROOT/vcpkg" install \ | |
| --x-install-root=./.deps_vendor/vcpkg_installed_x64 \ | |
| --triplet=x64-osx-obs | |
| - name: Make universal binaries for vcpkg dependencies (macOS universal) | |
| shell: bash | |
| run: | | |
| ./scripts/lipo_vcpkg_macos.sh \ | |
| ./.deps_vendor/vcpkg_installed_arm64/arm64-osx-obs \ | |
| ./.deps_vendor/vcpkg_installed_x64/x64-osx-obs \ | |
| ./.deps_vendor/vcpkg_installed/universal-osx-obs | |
| - name: Download dependencies | |
| shell: bash | |
| run: cmake -P ./scripts/download_deps.cmake | |
| - name: Build libobs (macOS universal) | |
| shell: bash | |
| run: ./scripts/build_libobs_macos.sh | |
| - name: Configure (macOS universal) | |
| shell: bash | |
| run: cmake --preset macos-ci | |
| - name: Build (macOS universal) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cmake --build --preset macos-ci | tee ./Build.txt | xcbeautify | |
| - name: Test (macOS universal) | |
| if: github.event_name == 'pull_request' | |
| shell: bash | |
| run: ctest --preset macos-ci --output-on-failure | |
| - name: Set up macOS Signing Certificates | |
| if: github.event_name == 'push' | |
| id: codesign | |
| uses: ./.github/actions/setup-macos-codesigning | |
| with: | |
| MACOS_SIGNING_APPLICATION_IDENTITY: ${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }} | |
| MACOS_SIGNING_CERT: ${{ secrets.MACOS_SIGNING_CERT }} | |
| MACOS_SIGNING_CERT_PASSWORD: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }} | |
| - name: Package (macOS universal) | |
| shell: bash | |
| env: | |
| NO_CODESIGN: ${{ github.event_name != 'push' }} | |
| MACOS_SIGNING_APPLICATION_IDENTITY: ${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }} | |
| MACOS_SIGNING_INSTALLER_IDENTITY: ${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }} | |
| PLUGIN_NAME: ${{ steps.metadata.outputs.name }} | |
| PLUGIN_VERSION: ${{ steps.metadata.outputs.version }} | |
| BUNDLE_ID: ${{ steps.metadata.outputs.bundleId }} | |
| DISPLAY_NAME: ${{ steps.metadata.outputs.displayName }} | |
| run: | | |
| set -euo pipefail | |
| shopt -s nullglob | |
| cmake --install build_macos --config RelWithDebInfo --strip \ | |
| --prefix ./release/payload/Library/Application\ Support/obs-studio/plugins | |
| PLUGIN_BUNDLE=(./release/payload/Library/Application\ Support/obs-studio/plugins/*.plugin) | |
| if [[ "${#PLUGIN_BUNDLE[@]}" -ne 1 ]]; then | |
| echo "Error: PLUGIN_BUNDLE = ${PLUGIN_BUNDLE[@]}" | |
| exit 1 | |
| fi | |
| if [[ "$NO_CODESIGN" != true ]]; then | |
| codesign --sign "$MACOS_SIGNING_APPLICATION_IDENTITY" --force --deep --options runtime --timestamp "${PLUGIN_BUNDLE[0]}" | |
| fi | |
| pkgbuild --root ./release/payload --identifier "$BUNDLE_ID" --version "$PLUGIN_VERSION" ./release/component.pkg | |
| { | |
| printf '<?xml version="1.0" encoding="utf-8"?>\n' | |
| printf '<installer-gui-script minSpecVersion="2">\n' | |
| printf ' <title>%s</title>\n' "$DISPLAY_NAME" | |
| printf ' <options customize="never" require-scripts="false" hostArchitectures="x86_64,arm64"/>\n' | |
| printf ' <domains enable_localSystem="false" enable_currentUserHome="true" enable_anywhere="false"/>\n' | |
| printf ' <choices-outline>\n' | |
| printf ' <line choice="default"/>\n' | |
| printf ' </choices-outline>\n' | |
| printf ' <choice id="default" title="%s" visible="false">\n' "$DISPLAY_NAME" | |
| printf ' <pkg-ref id="%s"/>\n' "$BUNDLE_ID" | |
| printf ' </choice>\n' | |
| printf ' <pkg-ref id="%s" version="%s" onConclusion="none" auth="none">component.pkg</pkg-ref>\n' "$BUNDLE_ID" "$PLUGIN_VERSION" | |
| printf '</installer-gui-script>\n' | |
| } | tee ./release/distribution.xml | |
| PRODUCTBUILD_ARGS=( | |
| --distribution release/distribution.xml | |
| --package-path release | |
| ) | |
| if [[ "$NO_CODESIGN" != true ]]; then | |
| PRODUCTBUILD_ARGS+=(--sign "$MACOS_SIGNING_INSTALLER_IDENTITY") | |
| fi | |
| productbuild "${PRODUCTBUILD_ARGS[@]}" "./release/$PLUGIN_NAME-$PLUGIN_VERSION-macos-universal.pkg" | |
| - name: Notarize Installer | |
| if: github.event_name == 'push' | |
| shell: bash | |
| env: | |
| MACOS_NOTARIZATION_USERNAME: ${{ secrets.MACOS_NOTARIZATION_USERNAME }} | |
| MACOS_NOTARIZATION_PASSWORD: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }} | |
| CODESIGN_TEAM: ${{ steps.codesign.outputs.CODESIGN_TEAM }} | |
| run: | | |
| set -euo pipefail | |
| xcrun notarytool submit ./release/*-macos-universal.pkg \ | |
| --apple-id "$MACOS_NOTARIZATION_USERNAME" \ | |
| --password "$MACOS_NOTARIZATION_PASSWORD" \ | |
| --team-id "$CODESIGN_TEAM" \ | |
| --wait | |
| xcrun stapler staple ./release/*-macos-universal.pkg | |
| - name: Archive Plugin dSYM | |
| shell: bash | |
| working-directory: ${{ github.workspace }}/build_macos/RelWithDebInfo | |
| env: | |
| PLUGIN_NAME: ${{ steps.metadata.outputs.name }} | |
| PLUGIN_VERSION: ${{ steps.metadata.outputs.version }} | |
| run: tar -cJf "$GITHUB_WORKSPACE/release/$PLUGIN_NAME-$PLUGIN_VERSION-macos-universal.dSYM.tar.xz" "$PLUGIN_NAME.plugin.dSYM" | |
| - name: Upload Plugin Binary | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: ${{ steps.metadata.outputs.name }}-pluginbinary-${{ runner.os }}-universal-${{ github.run_id }} | |
| path: | | |
| release/*-macos-universal.pkg | |
| release/*-macos-universal.dSYM.tar.xz | |
| if-no-files-found: error | |
| retention-days: ${{ env.PLUGINBINARY_RETENTION_DAYS }} | |
| - name: Upload Logs | |
| if: always() && runner.debug == '1' | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: logs-plugin-${{ runner.os }}-${{ github.run_id }} | |
| path: Build.txt | |
| if-no-files-found: warn | |
| prepare-ubuntu-x86_64: | |
| name: Prepare Builder for Ubuntu x86_64 | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| permissions: | |
| artifact-metadata: write | |
| attestations: write | |
| contents: read | |
| id-token: write | |
| packages: write | |
| outputs: | |
| BUILDER_IMAGE: "${{ fromJSON(steps.meta.outputs.json).tags[0] }}" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Extract vcpkg configuration | |
| id: vcpkg-configuration | |
| uses: ./.github/actions/extract-vcpkg-configuration | |
| with: | |
| path: ${{ github.workspace }}/vcpkg-configuration.json | |
| - name: Log in to the GitHub Container registry | |
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: Extract metadata for builder image | |
| id: meta | |
| uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0 | |
| with: | |
| images: ghcr.io/${{ github.repository }}-ubuntu-builder | |
| tags: | | |
| type=raw,value=runid-${{ github.run_id }},priority=10000 | |
| type=raw,value=latest | |
| - name: Build and Push builder image (Ubuntu) | |
| id: push | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| with: | |
| build-args: ARG_VCPKG_DEFAULT_REGISTRY_BASELINE=${{ steps.vcpkg-configuration.outputs.DEFAULT_REGISTRY_BASELINE }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| context: ${{ github.workspace }} | |
| file: "Dockerfile.ubuntu-24.04" | |
| labels: ${{ steps.meta.outputs.labels }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| - name: Generate artifact attestation for builder image (Ubuntu) | |
| uses: actions/attest@e18a799f23337c367f76b067253d6f53abc6f03d # v4.1.0 | |
| with: | |
| subject-name: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} | |
| subject-digest: ${{ steps.push.outputs.digest }} | |
| build-ubuntu-x86_64: | |
| name: Build Plugin for Ubuntu x86_64 | |
| needs: prepare-ubuntu-x86_64 | |
| environment: ${{ github.event_name == 'push' && 'production-ubuntu' || 'development' }} | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 180 | |
| container: | |
| image: ${{ needs.prepare-ubuntu-x86_64.outputs.BUILDER_IMAGE }} | |
| permissions: | |
| contents: read | |
| env: | |
| ORT_CCACHE_DIR: ${{ github.workspace }}/.ort_ccache | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: recursive | |
| - name: Extract plugin metadata | |
| id: metadata | |
| uses: ./.github/actions/extract-buildspec | |
| - name: Install dependencies from apt (Ubuntu x86_64) | |
| run: | | |
| echo "man-db man-db/auto-update boolean false" | sudo debconf-set-selections | |
| sudo apt-get remove --purge -y man-db | |
| sudo add-apt-repository -y ppa:obsproject/obs-studio | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| libgles2-mesa-dev \ | |
| libqt6svg6-dev \ | |
| libsimde-dev \ | |
| obs-studio \ | |
| qt6-base-dev \ | |
| qt6-base-private-dev | |
| - name: Install dependencies from vcpkg (Ubuntu x86_64) | |
| shell: bash | |
| run: | | |
| VCPKG_ROOT="$VCPKG_INSTALLATION_ROOT" "$VCPKG_INSTALLATION_ROOT/vcpkg" install \ | |
| --x-install-root=./.deps_vendor/vcpkg_installed \ | |
| --triplet=x64-linux-obs | |
| - name: Configure (Ubuntu x86_64) | |
| shell: bash | |
| run: cmake --preset ubuntu-ci-x86_64 | |
| - name: Build (Ubuntu x86_64) | |
| shell: bash | |
| run: cmake --build --preset ubuntu-ci-x86_64 | |
| - name: Test (Ubuntu x86_64) | |
| if: github.event_name == 'pull_request' | |
| shell: bash | |
| run: ctest --preset ubuntu-ci-x86_64 --output-on-failure | |
| - name: Package (Ubuntu x86_64) | |
| shell: bash | |
| working-directory: ${{ github.workspace }}/build_x86_64 | |
| run: cpack -G DEB | |
| - name: Upload Plugin Binary | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: ${{ steps.metadata.outputs.name }}-pluginbinary-${{ runner.os }}-x86_64-${{ github.run_id }} | |
| path: | | |
| release/*-x86_64-linux-gnu.deb | |
| release/*-x86_64-linux-gnu-dbgsym.ddeb | |
| if-no-files-found: error | |
| retention-days: ${{ env.PLUGINBINARY_RETENTION_DAYS }} | |
| create-release: | |
| name: Create Release | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| needs: [build-windows-x64, build-macos-universal, build-ubuntu-x86_64] | |
| runs-on: ubuntu-slim | |
| permissions: | |
| artifact-metadata: write | |
| attestations: write | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Extract plugin metadata | |
| id: metadata | |
| uses: ./.github/actions/extract-buildspec | |
| - name: Select secure directory | |
| id: secure-dir | |
| run: | | |
| { | |
| printf 'artifacts=' | |
| mktemp -d -p "$RUNNER_TEMP" "artifacts.XXXXXXXXXX" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Download plugin binaries | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| pattern: ${{ steps.metadata.outputs.name }}-pluginbinary-* | |
| merge-multiple: true | |
| path: ${{ steps.secure-dir.outputs.artifacts }} | |
| - name: Attest plugin binary artifacts | |
| id: attest | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: ${{ steps.secure-dir.outputs.artifacts }}/* | |
| - name: Create Draft Release | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BUNDLE_PATH: ${{ steps.attest.outputs.bundle-path }} | |
| working-directory: ${{ steps.secure-dir.outputs.artifacts }} | |
| run: | | |
| set -euo pipefail | |
| shopt -s nullglob | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| GH_RELEASE_CREATE_ARGS=( | |
| "$BUNDLE_PATH" | |
| --draft | |
| --generate-notes | |
| --title "$TAG_NAME" | |
| ) | |
| gh release create "$TAG_NAME" ./* "${GH_RELEASE_CREATE_ARGS[@]}" |