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..4904b0b 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) @@ -25,11 +22,17 @@ target_sources(${PROJECT_NAME} PRIVATE transition-table.hpp) if(BUILD_OUT_OF_TREE) - find_package(libobs REQUIRED) - find_package(obs-frontend-api REQUIRED) - include(cmake/ObsPluginHelpers.cmake) - set(OBS_FRONTEND_API_NAME "obs-frontend-api") + 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() + if(OBS_VERSION VERSION_GREATER_EQUAL 30.1.0) + find_package(Qt6 COMPONENTS Core Widgets) + else() + find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui) + endif() set(OBS_FRONTEND_API_NAME "frontend-api") endif() @@ -55,8 +58,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} @@ -65,25 +66,25 @@ target_link_libraries(${PROJECT_NAME} OBS::libobs) if(BUILD_OUT_OF_TREE) - if(NOT LIB_OUT_DIR) - set(LIB_OUT_DIR "/lib/obs-plugins") - endif() - if(NOT DATA_OUT_DIR) - set(DATA_OUT_DIR "/share/obs/obs-plugins/${PROJECT_NAME}") - endif() - set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") - install(TARGETS ${PROJECT_NAME} - LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR}) - install(DIRECTORY data/locale - DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR}) - setup_plugin_target(${PROJECT_NAME}) + if(NOT LIB_OUT_DIR) + set(LIB_OUT_DIR "/lib/obs-plugins") + endif() + if(NOT DATA_OUT_DIR) + set(DATA_OUT_DIR "/share/obs/obs-plugins/${PROJECT_NAME}") + endif() + set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") + install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR}) + install(DIRECTORY data/locale + DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR}) + setup_plugin_target(${PROJECT_NAME}) else() - target_include_directories(${PROJECT_NAME} PRIVATE - "${CMAKE_SOURCE_DIR}/UI/obs-frontend-api") - if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0) - set_target_properties_obs(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro" PREFIX "") - else() - set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro") - setup_plugin_target(${PROJECT_NAME}) - endif() + target_include_directories(${PROJECT_NAME} PRIVATE + "${CMAKE_SOURCE_DIR}/UI/obs-frontend-api") + if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0) + set_target_properties_obs(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro" PREFIX "") + else() + set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro") + setup_plugin_target(${PROJECT_NAME}) + endif() endif()