From aab605b57eaa1614f2a0967bb38f1151aaf75905 Mon Sep 17 00:00:00 2001 From: Exeldro Date: Wed, 27 Nov 2024 09:05:27 +0100 Subject: [PATCH] update build --- .github/workflows/build.yml | 58 +++++++++++++------------------------ CMakeLists.txt | 6 +--- 2 files changed, 21 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d705bfa..b302018 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,13 +29,13 @@ jobs: shell: zsh {0} steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: path: plugin submodules: recursive - name: Checkout obs-studio - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: repository: 'obsproject/obs-studio' path: obs-studio @@ -79,7 +79,7 @@ jobs: - name: Restore Compilation Cache id: ccache-cache - uses: actions/cache@v3.0.11 + uses: actions/cache@v4.0.0 with: path: ${{ github.workspace }}/.ccache key: macos-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }} @@ -133,7 +133,7 @@ jobs: codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }} - name: Upload Build Artifact - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }} path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-macos-${{ matrix.arch }}.pkg @@ -146,13 +146,13 @@ jobs: ubuntu: ['ubuntu-20.04', 'ubuntu-22.04'] steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: repository: obsproject/obs-studio ref: ${{ env.OBS_VERSION }} submodules: 'recursive' - name: "Checkout plugin" - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: path: UI/frontend-plugins/${{ env.PLUGIN_NAME }} - name: Add plugin to obs cmake @@ -182,7 +182,7 @@ jobs: mv ./UI/frontend-plugins/${{ env.PLUGIN_NAME }}/data ./${{ env.PLUGIN_NAME }}/data tar -cvzf "${FILE_NAME}" ${{ env.PLUGIN_NAME }} - name: 'Publish' - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: '${{ env.FILE_NAME }}' path: '*.tar.gz' @@ -207,15 +207,15 @@ jobs: WINDOWS_DEPS_VERSION: '2022-08-02' steps: - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1.3 + uses: microsoft/setup-msbuild@v2 - name: Checkout obs - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: repository: obsproject/obs-studio ref: ${{ env.OBS_VERSION }} submodules: 'recursive' - name: Checkout plugin - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: path: UI/frontend-plugins/${{ env.PLUGIN_NAME}} - name: Add plugin to obs cmake @@ -252,13 +252,13 @@ jobs: exit 0 - name: Publish zip if: success() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: '${{ env.FILE_NAME }}' path: package/* - name: Publish Installer Files - if: success() - uses: actions/upload-artifact@v3.1.1 + if: success() && matrix.target == 'x64' + uses: actions/upload-artifact@v4.3.1 with: name: 'installer-files' path: installer/* @@ -279,37 +279,23 @@ jobs: $env:FILE_NAME_X64="${{ env.PLUGIN_NAME }}-${{ github.sha }}-windows-x64" echo "FILE_NAME_X64=${env:FILE_NAME_X64}" >> ${env:GITHUB_ENV} - name: Retrieve x86 build - uses: actions/download-artifact@v3.0.1 + uses: actions/download-artifact@v4.1.2 with: name: '${{ env.FILE_NAME_X86 }}' path: ./package - name: Retrieve x64 build - uses: actions/download-artifact@v3.0.1 + uses: actions/download-artifact@v4.1.2 with: name: '${{ env.FILE_NAME_X64 }}' path: ./package - name: Retrieve installer files - uses: actions/download-artifact@v3.0.1 + uses: actions/download-artifact@v4.1.2 with: name: 'installer-files' path: . - - name: Create Code Signing Certificate - if: success() && github.event_name != 'pull_request' - run: | - New-Item -ItemType directory -Path certificate - Set-Content -Path certificate\certificate.txt -Value '${{ secrets.CERTIFICATE }}' - certutil -decode certificate\certificate.txt certificate\certificate.pfx - - name: Code Sign 32 - if: success() && github.event_name != 'pull_request' - run: | - & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x86/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\32bit\${{ env.PLUGIN_NAME }}.dll - - name: Code Sign 64 - if: success() && github.event_name != 'pull_request' - run: | - & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\64bit\${{ env.PLUGIN_NAME }}.dll - name: Publish zip if: success() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: '${{ env.FILE_NAME }}' path: package/* @@ -320,17 +306,13 @@ jobs: - name: "Package Installer (Compile)" run: | & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\installer.iss" - - name: Code Sign Installer - if: success() && github.event_name != 'pull_request' - run: | - & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\${{ env.PLUGIN_NAME }}-installer.exe - name: Publish installer if: success() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: '${{ env.FILE_NAME }}-installer' path: package/*.exe - name: Remove temp artifacts - uses: geekyeggo/delete-artifact@v2.0.0 + uses: geekyeggo/delete-artifact@v4.1.0 with: - name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}\ninstaller-files" \ No newline at end of file + name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}" diff --git a/CMakeLists.txt b/CMakeLists.txt index b5d9dc0..741deba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,6 @@ # --- Detect if the plugin is build out of tree or not --- if(CMAKE_PROJECT_NAME STREQUAL "obs-studio") set(BUILD_OUT_OF_TREE OFF) - if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0) - legacy_check() - endif() else() set(BUILD_OUT_OF_TREE ON) cmake_minimum_required(VERSION 3.18) @@ -28,6 +25,7 @@ if(BUILD_OUT_OF_TREE) find_package(libobs REQUIRED) find_package(obs-frontend-api REQUIRED) include(cmake/ObsPluginHelpers.cmake) + find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui) set(OBS_FRONTEND_API_NAME "obs-frontend-api") else() set(OBS_FRONTEND_API_NAME "frontend-api") @@ -55,8 +53,6 @@ elseif(OS_MACOS) target_compile_options(${PROJECT_NAME} PRIVATE -Wall) endif() -# lines if you want add Qt UI in your plugin -find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui) set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON) target_link_libraries(${PROJECT_NAME}