Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Nov 27, 2024
1 parent 640a30f commit aab605b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 43 deletions.
58 changes: 20 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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/*
Expand All @@ -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/*
Expand All @@ -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"
name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}"
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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")
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit aab605b

Please sign in to comment.