From 715b8f2abe3ec83996d65c5cfe44c3a78c8792f2 Mon Sep 17 00:00:00 2001 From: univrsal Date: Mon, 17 Jun 2024 16:47:54 +0200 Subject: [PATCH] CI: Fix windows, probably --- .github/scripts/Build-Windows.ps1 | 13 +++++++++++++ .github/scripts/Package-Windows.ps1 | 15 +++++++++++++++ .github/workflows/build-project.yaml | 6 ++++++ CMakeLists.txt | 7 +++++-- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/scripts/Build-Windows.ps1 b/.github/scripts/Build-Windows.ps1 index 5f322960..2e68fae1 100644 --- a/.github/scripts/Build-Windows.ps1 +++ b/.github/scripts/Build-Windows.ps1 @@ -25,6 +25,17 @@ if ( $PSVersionTable.PSVersion -lt '7.0.0' ) { exit 2 } +function BuildClient { + Log-Group "Configuring ${ProductName}-client..." + Invoke-External cmake -S "${ProjectRoot}/client" -B "${ProjectRoot}/client_build" -A $Target -DCMAKE_BUILD_TYPE=$Configuration + + Log-Group "Building ${ProductName}-client..." + Invoke-External cmake --build "${ProjectRoot}/client_build" --config $Configuration --parallel + + Log-Group "Installing ${ProductName}-client..." + Invoke-External cmake --install "${ProjectRoot}/client_build" --config $Configuration --prefix "${ProjectRoot}/release/${Configuration}" +} + function Build { trap { Pop-Location -Stack BuildTemp -ErrorAction 'SilentlyContinue' @@ -94,6 +105,8 @@ function Build { Log-Group "Building ${ProductName}..." Invoke-External cmake @CmakeBuildArgs + + BuildClient } Log-Group "Install ${ProductName}..." Invoke-External cmake @CmakeInstallArgs diff --git a/.github/scripts/Package-Windows.ps1 b/.github/scripts/Package-Windows.ps1 index 67b02093..eb546216 100644 --- a/.github/scripts/Package-Windows.ps1 +++ b/.github/scripts/Package-Windows.ps1 @@ -25,6 +25,18 @@ if ( $PSVersionTable.PSVersion -lt '7.0.0' ) { exit 2 } +function PackageClientAndPresets { + $PresetsName = "${ProductName}-${ProductVersion}-presets" + + $CompressPresetsArgs = @{ + Path = (Get-ChildItem -Path "${ProjectRoot}/presets/") + CompressionLevel = 'Optimal' + DestinationPath = "${ProjectRoot}/release/${PresetsName}.zip" + Verbose = ($Env:CI -ne $null) + } + Compress-Archive -Force @CompressPresetsArgs +} + function Package { trap { Pop-Location -Stack BuildTemp -ErrorAction 'SilentlyContinue' @@ -65,6 +77,9 @@ function Package { Remove-Item @RemoveArgs Log-Group "Archiving ${ProductName}..." + + PackageClientAndPresets + $CompressArgs = @{ Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*") CompressionLevel = 'Optimal' diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 242d74c5..4b4192ea 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -185,3 +185,9 @@ jobs: with: name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64-${{ needs.check-event.outputs.commitHash }} path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64*.* + + - name: Upload Presets 📡 + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-presets-${{ needs.check-event.outputs.commitHash }} + path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-presets*.* diff --git a/CMakeLists.txt b/CMakeLists.txt index 22fa32d2..9d155632 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,8 +32,11 @@ if (WIN32 OR WIN64) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SDL2_DLLS} $) - - install(FILES ${SDL2_DLLS} DESTINATION ${OBS_PLUGIN_DESTINATION}) + + install(FILES ${SDL2_DLLS} DESTINATION + CONFIGURATIONS RelWithDebInfo Debug Release + DESTINATION obs-plugins/64bit + ) endif() string(TIMESTAMP TODAY "%Y.%m.%d %H:%M")