diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62fd0dae1..131bee06a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -284,7 +284,7 @@ jobs: if: always() strategy: matrix: - arch: [64, 32] + arch: [x64, x86] env: CMAKE_GENERATOR: 'Visual Studio 16 2019' CMAKE_SYSTEM_VERSION: '10.0.18363.657' @@ -325,8 +325,8 @@ jobs: env: CACHE_NAME: 'cef-cache' with: - path: ${{ github.workspace }}/obs-build-dependencies/cef_binary_${{ env.CEF_BUILD_VERSION_WIN }}_windows${{ matrix.arch }}_minimal - key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_BUILD_VERSION_WIN }}-${{ env.CACHE_REVISION }} + path: ${{ github.workspace }}/obs-build-dependencies/cef_binary_${{ env.CEF_BUILD_VERSION_WIN }}_windows_${{ matrix.arch }} + key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.CEF_BUILD_VERSION_WIN }}-${{ matrix.arch }}-${{ env.CACHE_REVISION }} - name: Setup Environment id: setup @@ -338,23 +338,23 @@ jobs: env: RESTORED_VLC: ${{ steps.vlc-cache.outputs.cache-hit }} RESTORED_CEF: ${{ steps.cef-cache.outputs.cache-hit }} - run: CI/windows/01_install_dependencies.ps1 -BuildArch ${{ matrix.arch }}-bit + run: CI/windows/01_install_dependencies.ps1 -BuildArch ${{ matrix.arch }} - name: 'Build OBS' - run: CI/windows/02_build_obs.ps1 -BuildArch ${{ matrix.arch }}-bit + run: CI/windows/02_build_obs.ps1 -BuildArch ${{ matrix.arch }} - name: 'Create build artifact' if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }} run: | - CI/windows/03_package_obs.ps1 -BuildArch ${{ matrix.arch }}-bit -Package - $ArtifactName = Get-ChildItem -filter "OBS-Studio-*-Win${{ matrix.arch }}.zip" -File + CI/windows/03_package_obs.ps1 -BuildArch ${{ matrix.arch }} -Package + $ArtifactName = Get-ChildItem -filter "OBS-Studio-*-Win-${{ matrix.arch }}.zip" -File Write-Output "FILE_NAME=${ArtifactName}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - name: 'Upload build artifact' if: ${{ success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1') }} uses: actions/upload-artifact@v3 with: - name: 'obs-win${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}' + name: 'obs-win-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}' path: '${{ env.FILE_NAME }}' linux_package: @@ -431,12 +431,12 @@ jobs: $null = New-Item -ItemType Directory -Force -Path install_temp } - Expand-Archive -Path "$(Get-ChildItem -filter "OBS-Studio-*-Win32.zip" -File)" -DestinationPath install_temp - Expand-Archive -Path "$(Get-ChildItem -filter "OBS-Studio-*-Win64.zip" -File)" -Force -DestinationPath install_temp + Expand-Archive -Path "$(Get-ChildItem -filter "OBS-Studio-*-Win-x86.zip" -File)" -DestinationPath install_temp + Expand-Archive -Path "$(Get-ChildItem -filter "OBS-Studio-*-Win-x64.zip" -File)" -Force -DestinationPath install_temp CI/windows/03_package_obs.ps1 -CombinedArchs -Package - $ArtifactName = (Get-ChildItem -filter "OBS-Studio-*-Windows.zip" -File).Name + $ArtifactName = (Get-ChildItem -filter "OBS-Studio-*-Win-x64+x86.zip" -File).Name Write-Output "FILE_NAME=${ArtifactName}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - name: 'Upload build artifact' diff --git a/CI/build-windows.ps1 b/CI/build-windows.ps1 index b4e882871..c3035e8bf 100644 --- a/CI/build-windows.ps1 +++ b/CI/build-windows.ps1 @@ -7,8 +7,8 @@ Param( [Switch]$BuildInstaller, [Switch]$CombinedArchs, [String]$BuildDirectory = "build", - [ValidateSet("32-bit", "64-bit")] - [String]$BuildArch = (Get-CimInstance CIM_OperatingSystem).OSArchitecture, + [ValidateSet('x86', 'x64')] + [String]$BuildArch = ('x86', 'x64')[[System.Environment]::Is64BitOperatingSystem], [ValidateSet("Release", "RelWithDebInfo", "MinSizeRel", "Debug")] [String]$BuildConfiguration = "RelWithDebInfo" ) @@ -30,11 +30,11 @@ Param( # -BuildDirectory : Directory to use for builds # Default: build64 on 64-bit systems # build32 on 32-bit systems -# -BuildArch : Build architecture to use ("32-bit" or "64-bit") +# -BuildArch : Build architecture to use (x86 or x64) # -BuildConfiguration : Build configuration to use # Default: RelWithDebInfo # -CombinedArchs : Create combined packages and installer -# (64-bit and 32-bit) - Default: off +# (x86 and x64) - Default: off # -Package : Prepare folder structure for installer creation # # Environment Variables (optional): @@ -87,16 +87,16 @@ function Build-OBS-Main { } if(!($SkipDependencyChecks.isPresent)) { - Install-Dependencies -BuildArch 64-bit + Install-Dependencies -BuildArch x64 } - Build-OBS -BuildArch 64-bit + Build-OBS -BuildArch x64 if(!($SkipDependencyChecks.isPresent)) { - Install-Dependencies -BuildArch 32-bit + Install-Dependencies -BuildArch x86 } - Build-OBS -BuildArch 32-bit + Build-OBS -BuildArch x86 } else { if(!($SkipDependencyChecks.isPresent)) { Install-Dependencies @@ -120,7 +120,7 @@ function Print-Usage { "-Verbose : Enable more verbose build process output" "-SkipDependencyChecks : Skip dependency checks - Default: off", "-BuildDirectory : Directory to use for builds - Default: build64 on 64-bit systems, build32 on 32-bit systems", - "-BuildArch : Build architecture to use ('32-bit' or '64-bit') - Default: local architecture", + "-BuildArch : Build architecture to use (x86 or x64) - Default: local architecture", "-BuildConfiguration : Build configuration to use - Default: RelWithDebInfo", "-CombinedArchs : Create combined packages and installer (64-bit and 32-bit) - Default: off" "-Package : Prepare folder structure for installer creation" diff --git a/CI/windows/01_install_dependencies.ps1 b/CI/windows/01_install_dependencies.ps1 index 395a5c1ae..95c01bffa 100644 --- a/CI/windows/01_install_dependencies.ps1 +++ b/CI/windows/01_install_dependencies.ps1 @@ -2,8 +2,8 @@ Param( [Switch]$Help = $(if (Test-Path variable:Help) { $Help }), [Switch]$Quiet = $(if (Test-Path variable:Quiet) { $Quiet }), [Switch]$Verbose = $(if (Test-Path variable:Verbose) { $Verbose }), - [ValidateSet("32-bit", "64-bit")] - [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { (Get-CimInstance CIM_OperatingSystem).OSArchitecture }) + [ValidateSet('x86', 'x64')] + [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { ('x86', 'x64')[[System.Environment]::Is64BitOperatingSystem] }) ) ############################################################################## @@ -26,7 +26,7 @@ Function Install-obs-deps { Write-Status "Setup for pre-built Windows OBS dependencies v${Version}" Ensure-Directory $DepsBuildDir - $ArchSuffix = "$(if ($BuildArch -eq "64-bit") { "x64" } else { "x86" })" + $ArchSuffix = $BuildArch if (!(Test-Path "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}")) { @@ -52,7 +52,7 @@ function Install-qt-deps { Write-Status "Setup for pre-built dependency Qt v${Version}" Ensure-Directory $DepsBuildDir - $ArchSuffix = "$(if ($BuildArch -eq "64-bit") { "x64" } else { "x86" })" + $ArchSuffix = $BuildArch if (!(Test-Path "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}/mkspecs")) { @@ -101,7 +101,7 @@ function Install-cef { Write-Status "Setup for dependency CEF v${Version} - ${BuildArch}" Ensure-Directory $DepsBuildDir - $ArchSuffix = "$(if ($BuildArch -eq "64-bit") { "x64" } else { "x86" })" + $ArchSuffix = $BuildArch if (!((Test-Path "${DepsBuildDir}/cef_binary_${Version}_windows_${ArchSuffix}") -and (Test-Path "${DepsBuildDir}/cef_binary_${Version}_windows_${ArchSuffix}/build/libcef_dll_wrapper/Release/libcef_dll_wrapper.lib"))) { Write-Step "Download..." @@ -160,7 +160,7 @@ function Print-Usage { "-Quiet : Suppress most build process output", "-Verbose : Enable more verbose build process output", "-Choco : Enable automatic dependency installation via Chocolatey - Default: off" - "-BuildArch : Build architecture to use (32-bit or 64-bit) - Default: local architecture" + "-BuildArch : Build architecture to use (x86 or x64) - Default: local architecture" ) $Lines | Write-Host diff --git a/CI/windows/02_build_obs.ps1 b/CI/windows/02_build_obs.ps1 index 0a830585b..b8db62df7 100644 --- a/CI/windows/02_build_obs.ps1 +++ b/CI/windows/02_build_obs.ps1 @@ -3,8 +3,8 @@ Param( [Switch]$Quiet = $(if (Test-Path variable:Quiet) { $Quiet }), [Switch]$Verbose = $(if (Test-Path variable:Verbose) { $Verbose }), [String]$BuildDirectory = $(if (Test-Path variable:BuildDirectory) { "${BuildDirectory}" } else { "build" }), - [ValidateSet("32-bit", "64-bit")] - [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { (Get-CimInstance CIM_OperatingSystem).OSArchitecture }), + [ValidateSet('x86', 'x64')] + [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { ('x86', 'x64')[[System.Environment]::Is64BitOperatingSystem] }), [ValidateSet("Release", "RelWithDebInfo", "MinSizeRel", "Debug")] [String]$BuildConfiguration = $(if (Test-Path variable:BuildConfiguration) { "${BuildConfiguration}" } else { "RelWithDebInfo" }) ) @@ -41,7 +41,7 @@ function Build-OBS { Ensure-Directory ${CheckoutDir} Write-Step "Build OBS targets..." - Invoke-Expression "cmake --build $(if($BuildArch -eq "64-bit") { "build64" } else { "build32" }) --config ${BuildConfiguration}" + Invoke-Expression "cmake --build $(if($BuildArch -eq "x64") { "build64" } else { "build32" }) --config ${BuildConfiguration}" } function Configure-OBS { @@ -56,10 +56,10 @@ function Configure-OBS { } # TODO: Clean up archive and directory naming across dependencies - $CmakePrefixPath = Resolve-Path -Path "${CheckoutDir}/../obs-build-dependencies/windows-deps-${WindowsDepsVersion}-$(if (${BuildArch} -eq "64-bit") { "x64" } else { "x86" })" - $CefDirectory = Resolve-Path -Path "${CheckoutDir}/../obs-build-dependencies/cef_binary_${WindowsCefVersion}_windows_$(if (${BuildArch} -eq "64-bit") { "x64" } else { "x86" })" - $BuildDirectoryActual = "${BuildDirectory}$(if (${BuildArch} -eq "64-bit") { "64" } else { "32" })" - $GeneratorPlatform = "$(if (${BuildArch} -eq "64-bit") { "x64" } else { "Win32" })" + $CmakePrefixPath = Resolve-Path -Path "${CheckoutDir}/../obs-build-dependencies/windows-deps-${WindowsDepsVersion}-${BuildArch}" + $CefDirectory = Resolve-Path -Path "${CheckoutDir}/../obs-build-dependencies/cef_binary_${WindowsCefVersion}_windows_${BuildArch}" + $BuildDirectoryActual = "${BuildDirectory}$(if (${BuildArch} -eq "x64") { "64" } else { "32" })" + $GeneratorPlatform = "$(if (${BuildArch} -eq "x64") { "x64" } else { "Win32" })" $CmakeCommand = @( "-S . -B `"${BuildDirectoryActual}`"", @@ -112,7 +112,7 @@ function Print-Usage { "-Quiet : Suppress most build process output", "-Verbose : Enable more verbose build process output", "-BuildDirectory : Directory to use for builds - Default: build64 on 64-bit systems, build32 on 32-bit systems", - "-BuildArch : Build architecture to use (32-bit or 64-bit) - Default: local architecture", + "-BuildArch : Build architecture to use (x86 or x64) - Default: local architecture", "-BuildConfiguration : Build configuration to use - Default: RelWithDebInfo" ) diff --git a/CI/windows/03_package_obs.ps1 b/CI/windows/03_package_obs.ps1 index 7e4aa96af..c5620b404 100644 --- a/CI/windows/03_package_obs.ps1 +++ b/CI/windows/03_package_obs.ps1 @@ -5,8 +5,8 @@ Param( [Switch]$BuildInstaller = $(if ($BuildInstaller.isPresent) { $BuildInstaller }), [Switch]$CombinedArchs = $(if ($CombinedArchs.isPresent) { $CombinedArchs }), [String]$BuildDirectory = $(if (Test-Path variable:BuildDirectory) { "${BuildDirectory}" } else { "build" }), - [ValidateSet("32-bit", "64-bit")] - [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { (Get-CimInstance CIM_OperatingSystem).OSArchitecture }), + [ValidateSet('x86', 'x64')] + [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { ('x86', 'x64')[[System.Environment]::Is64BitOperatingSystem] }), [ValidateSet("Release", "RelWithDebInfo", "MinSizeRel", "Debug")] [String]$BuildConfiguration = $(if (Test-Path variable:BuildConfiguration) { "${BuildConfiguration}" } else { "RelWithDebInfo" }) ) @@ -57,7 +57,7 @@ function Package-OBS { $CompressVars = @{ Path = "${CheckoutDir}/build/install/*" CompressionLevel = "Optimal" - DestinationPath = "${FileName}-Windows.zip" + DestinationPath = "${FileName}-Win-x86+x64.zip" } Write-Step "Creating zip archive..." @@ -66,14 +66,14 @@ function Package-OBS { Compress-Archive -Force @CompressVars $ProgressPreference = 'Continue' - } elseif ($BuildArch -eq "64-bit") { + } elseif ($BuildArch -eq "x64") { Write-Step "Install 64-bit OBS..." Invoke-Expression "cmake --build `"${BuildDirectory}64`" --config ${BuildConfiguration} -t install" $CompressVars = @{ Path = "${CheckoutDir}/build64/install/bin", "${CheckoutDir}/build64/install/data", "${CheckoutDir}/build64/install/obs-plugins" CompressionLevel = "Optimal" - DestinationPath = "${FileName}-Win64.zip" + DestinationPath = "${FileName}-Win-x64.zip" } Write-Step "Creating zip archive..." @@ -82,14 +82,14 @@ function Package-OBS { Compress-Archive -Force @CompressVars $ProgressPreference = 'Continue' - } elseif ($BuildArch -eq "32-bit") { + } elseif ($BuildArch -eq "x86") { Write-Step "Install 32-bit OBS..." Invoke-Expression "cmake --build `"${BuildDirectory}32`" --config ${BuildConfiguration} -t install" $CompressVars = @{ Path = "${CheckoutDir}/build32/install/bin", "${CheckoutDir}/build32/install/data", "${CheckoutDir}/build32/install/obs-plugins" CompressionLevel = "Optimal" - DestinationPath = "${FileName}-Win32.zip" + DestinationPath = "${FileName}-Win-x86.zip" } Write-Step "Creating zip archive..." @@ -136,7 +136,7 @@ function Print-Usage { "-Verbose : Enable more verbose build process output", "-CombinedArchs : Create combined architecture package", "-BuildDirectory : Directory to use for builds - Default: build64 on 64-bit systems, build32 on 32-bit systems", - "-BuildArch : Build architecture to use (32-bit or 64-bit) - Default: local architecture", + "-BuildArch : Build architecture to use (x86 or x64) - Default: local architecture", "-BuildConfiguration : Build configuration to use - Default: RelWithDebInfo" )