Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Dec 28, 2023
1 parent e0a674d commit bc82bc5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 50 deletions.
8 changes: 4 additions & 4 deletions .github/scripts/utils.zsh/check_packages
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ if (( ! ${+commands[packagesbuild]} )) {
pushd
mkcd ${project_root:h}/obs-build-dependencies

local packages_url='http://s.sudre.free.fr/Software/files/Packages.dmg'
local packages_url='http://s.sudre.free.fr/Software/files/Packages_1210_1.dmg'
local packages_hash='6afdd25386295974dad8f078b8f1e41cabebd08e72d970bf92f707c7e48b16c9'

if [[ ! -f Packages.dmg ]] {
if [[ ! -f Packages_1210_1.dmg ]] {
log_status 'Download Packages.app'
curl ${curl_opts} ${packages_url}
}

local image_checksum
read -r image_checksum _ <<< "$(sha256sum Packages.dmg)"
read -r image_checksum _ <<< "$(sha256sum Packages_1210_1.dmg)"

if [[ ${packages_hash} != ${image_checksum} ]] {
log_error "Checksum mismatch of Packages.app download.
Expand All @@ -42,7 +42,7 @@ Actual : ${image_checksum}"
return 2
}

hdiutil attach -noverify Packages.dmg &> /dev/null && log_status 'Packages.dmg image mounted.'
hdiutil attach -noverify Packages_1210_1.dmg &> /dev/null && log_status 'Packages_1210_1.dmg image mounted.'

log_info 'Installing Packages.app...'
packages_volume=$(hdiutil info -plist | grep '<string>/Volumes/Packages' | sed 's/.*<string>\(\/Volumes\/[^<]*\)<\/string>/\1/')
Expand Down
53 changes: 26 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
shell: zsh {0}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0
with:
path: plugin
submodules: recursive
Expand Down Expand Up @@ -61,25 +61,25 @@ jobs:
if [[ '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
'${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
'${{ secrets.MACOS_SIGNING_CERT }}' != '' ]] {
print '::set-output name=haveCodesignIdent::true'
print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT
} else {
print '::set-output name=haveCodesignIdent::false'
print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
}
if [[ '${{ secrets.MACOS_NOTARIZATION_USERNAME }}' != '' && \
'${{ secrets.MACOS_NOTARIZATION_PASSWORD }}' != '' ]] {
print '::set-output name=haveNotarizationUser::true'
print 'haveNotarizationUser=true' >> $GITHUB_OUTPUT
} else {
print '::set-output name=haveNotarizationUser::false'
print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT
}
print '::endgroup::'
print "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
print "::set-output name=commitHash::${"$(git rev-parse HEAD)"[0,9]}"
print "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
print "commitHash=${"$(git rev-parse HEAD)"[0,9]}" >> $GITHUB_OUTPUT
- name: Restore Compilation Cache
id: ccache-cache
uses: actions/cache@v3
uses: actions/cache@v3.0.11
with:
path: ${{ github.workspace }}/.ccache
key: macos-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
Expand All @@ -91,9 +91,9 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
run: |
if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]] {
print '::set-output name=found::true'
print 'found=true' >> $GITHUB_OUTPUT
} else {
print '::set-output name=found::false'
print 'found=false' >> $GITHUB_OUTPUT
}
- name: Install Apple Developer Certificate
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}

- name: Upload Build Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v3.1.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
uses: actions/checkout@v3.1.0
with:
repository: obsproject/obs-studio
ref: ${{ env.OBS_VERSION }}
submodules: 'recursive'
- name: "Checkout plugin"
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0
with:
path: plugins/${{ env.PLUGIN_NAME }}
- name: Add plugin to obs cmake
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
mv ./plugins/${{ env.PLUGIN_NAME }}/data ./${{ env.PLUGIN_NAME }}/data
tar -cvzf "${FILE_NAME}" ${{ env.PLUGIN_NAME }}
- name: 'Publish'
uses: actions/upload-artifact@v2.2.0
uses: actions/upload-artifact@v3.1.1
with:
name: '${{ env.FILE_NAME }}'
path: '*.tar.gz'
Expand All @@ -207,15 +207,15 @@ jobs:
WINDOWS_DEPS_VERSION: '2023-04-12'
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v1.1.3
- name: Checkout obs
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0
with:
repository: obsproject/obs-studio
ref: ${{ env.OBS_VERSION }}
submodules: 'recursive'
- name: Checkout plugin
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0
with:
path: 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@v2.2.0
uses: actions/upload-artifact@v3.1.1
with:
name: '${{ env.FILE_NAME }}'
path: package/*
- name: Publish Installer Files
if: success()
uses: actions/upload-artifact@v2.2.0
uses: actions/upload-artifact@v3.1.1
with:
name: 'installer-files'
path: installer/*
Expand All @@ -279,17 +279,17 @@ 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@v2
uses: actions/download-artifact@v3.0.1
with:
name: '${{ env.FILE_NAME_X86 }}'
path: ./package
- name: Retrieve x64 build
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3.0.1
with:
name: '${{ env.FILE_NAME_X64 }}'
path: ./package
- name: Retrieve installer files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3.0.1
with:
name: 'installer-files'
path: .
Expand All @@ -309,13 +309,12 @@ jobs:
& '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@v2.2.0
uses: actions/upload-artifact@v3.1.1
with:
name: '${{ env.FILE_NAME }}'
path: package/*
- name: "Package Installer (Prereqs)"
run: |
curl "-kL" "https://github.com/Xaymar/msvc-redist-helper/releases/download/0.1/msvc-redist-helper-64.exe" "-f" "--retry" "5" "-o" "msvc-redist-helper.exe"
curl "-kL" "https://files.jrsoftware.org/is/6/innosetup-6.0.3.exe" "-f" "--retry" "5" "-o" "inno.exe"
.\inno.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
- name: "Package Installer (Compile)"
Expand All @@ -327,11 +326,11 @@ jobs:
& '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@v2.2.0
uses: actions/upload-artifact@v3.1.1
with:
name: '${{ env.FILE_NAME }}-installer'
path: package/*.exe
- name: Remove temp artifacts
uses: geekyeggo/delete-artifact@v1
uses: geekyeggo/delete-artifact@v2.0.0
with:
name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}\ninstaller-files"
name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}\ninstaller-files"
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# --- 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 Down Expand Up @@ -105,9 +108,14 @@ if(BUILD_OUT_OF_TREE)
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")
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "plugins/exeldro")
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()
setup_plugin_target(${PROJECT_NAME})
27 changes: 10 additions & 17 deletions installer.iss.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "package/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Expand All @@ -56,7 +55,9 @@ begin
Result := ExpandConstant('{pf}\obs-studio');
// query the first registry value; if this succeeds, return the obtained value
if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then
Result := InstallPath
Result := InstallPath;
if RegQueryStringValue(HKLM64, 'SOFTWARE\OBS Studio', '', InstallPath) then
Result := InstallPath;
end;

/////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -107,20 +108,12 @@ begin
end;

/////////////////////////////////////////////////////////////////////
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
function NextButtonClick(PageId: Integer): Boolean;
begin
if (CurStep=ssInstall) then
begin
if (IsUpgrade()) then
begin
UnInstallOldVersion();
Result := True;
if (PageId = wpSelectDir) and not FileExists(ExpandConstant('{app}\bin\64bit\obs64.exe')) then begin
MsgBox('OBS Studio (bin\64bit\obs64.exe) does not seem to be installed in that folder. Please select the correct folder.', mbError, MB_OK);
Result := False;
exit;
end;
end;
if (CurStep=ssPostInstall) then
begin
ExtractTemporaryFile('msvc-redist-helper.exe');
Exec(ExpandConstant('{tmp}\msvc-redist-helper.exe'), '2019', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
end;
end;

0 comments on commit bc82bc5

Please sign in to comment.