Skip to content

Commit

Permalink
CI: Fix windows, probably
Browse files Browse the repository at this point in the history
  • Loading branch information
univrsal committed Jun 17, 2024
1 parent 89453da commit 715b8f2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/scripts/Build-Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -94,6 +105,8 @@ function Build {

Log-Group "Building ${ProductName}..."
Invoke-External cmake @CmakeBuildArgs

BuildClient
}
Log-Group "Install ${ProductName}..."
Invoke-External cmake @CmakeInstallArgs
Expand Down
15 changes: 15 additions & 0 deletions .github/scripts/Package-Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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*.*
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ if (WIN32 OR WIN64)
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SDL2_DLLS}
$<TARGET_FILE_DIR:${PROJECT_NAME}>)

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")
Expand Down

0 comments on commit 715b8f2

Please sign in to comment.