From e25851566cb59455b43cdbfcef66785adbb0c69e Mon Sep 17 00:00:00 2001 From: dimtpap Date: Sun, 14 Jul 2024 18:35:01 +0300 Subject: [PATCH] Test both OBS 28 and 30.2 --- .github/actions/build/action.yml | 94 ++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 71 +++++++----------------- .gitignore | 2 +- 3 files changed, 115 insertions(+), 52 deletions(-) create mode 100644 .github/actions/build/action.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 0000000..72c48a7 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,94 @@ +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: for-${{ inputs.obs-version }}/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: 'for-${{ inputs.obs-version }}/obs-src' + ref: ${{ inputs.obs-version }} + submodules: 'recursive' + - name: 'Install system dependencies' + shell: bash + 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' + shell: bash + working-directory: for-${{ inputs.obs-version }} + 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' + shell: bash + working-directory: for-${{ inputs.obs-version }} + run: cmake --build obs-src/build -j4 + - name: 'Install OBS' + if: steps.cache-obs.outputs.cache-hit != 'true' + shell: bash + working-directory: for-${{ inputs.obs-version }} + run: cmake --install obs-src/build --prefix obs + - name: 'Checkout' + uses: actions/checkout@v4 + with: + path: 'for-${{ inputs.obs-version }}/plugin' + - name: 'Configure' + shell: bash + working-directory: for-${{ inputs.obs-version }} + run: cmake -B plugin/build -S plugin -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dlibobs_DIR="$PWD/obs/lib/cmake/libobs/" + - name: 'Build' + shell: bash + working-directory: for-${{ inputs.obs-version }} + run: cmake --build plugin/build -j4 + - name: 'Package' + shell: bash + working-directory: for-${{ inputs.obs-version }} + 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: ${{ github.workspace }}/${{ inputs.plugin-output-path }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f48a9a8..83f5e83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,63 +13,32 @@ 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 - with: - path: ${{ github.workspace }}/obs/ - key: '30.2.0' - - name: Checkout OBS - if: steps.cache-obs.outputs.cache-hit != 'true' - uses: actions/checkout@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 + - name: Build for OBS >= 28 + uses: ./.github/actions/build + with: + obs-version: '28.0.0' + plugin-output-path: 'linux-pipewire-audio-obs28.tar.gz' + - name: 'Upload' + uses: actions/upload-artifact@v4 + with: + name: linux-pipewire-audio-obs28 + 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 + name: linux-pipewire-audio-obs30-2 + path: linux-pipewire-audio-obs30-2.tar.gz \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4680c9f..43db59d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,6 @@ install_manifest.txt compile_commands.json CTestTestfile.cmake _deps -build +/build .vscode \ No newline at end of file