CI: Update Windows workflow for updated CMake build system and scripts

This commit is contained in:
PatTheMav 2023-04-24 23:11:27 +02:00 committed by Ryan Foster
parent 5d746f650e
commit 4051cae1be

View file

@ -314,73 +314,36 @@ jobs:
runs-on: [windows-2022]
needs: [config, clang_check]
if: always()
strategy:
matrix:
arch: [x64, x86]
env:
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_SYSTEM_VERSION: '10.0.18363.657'
VIRTUALCAM-GUID: 'A3FCE0F5-3493-419F-958A-ABA1250EC20B'
BUILD_FOR_DISTRIBUTION: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
defaults:
run:
working-directory: 'obs-studio'
steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
submodules: 'recursive'
path: 'obs-studio'
fetch-depth: 0
- name: 'Add msbuild to PATH'
uses: microsoft/setup-msbuild@v1.1
- name: 'Restore VLC dependency from cache'
id: vlc-cache
uses: actions/cache@v3
env:
CACHE_NAME: 'vlc-cache'
with:
path: ${{ github.workspace }}/obs-build-dependencies/vlc-${{ env.VLC_VERSION_WIN }}
key: ${{ runner.os }}-pr-${{ env.CACHE_NAME }}-${{ env.VLC_VERSION_WIN }}-${{ env.CACHE_REVISION }}
- name: 'Restore Chromium Embedded Framework from cache'
id: cef-cache
uses: actions/cache@v3
env:
CACHE_NAME: 'cef-cache'
with:
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
run: |
$CommitHash = git rev-parse --short=9 HEAD
"commitHash=${CommitHash}" >> $env:GITHUB_OUTPUT
- name: 'Install dependencies'
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 }}
- name: 'Build OBS'
run: CI/windows/02_build_obs.ps1 -BuildArch ${{ matrix.arch }}
run: .github/scripts/Build-Windows.ps1 -Target x64 -Configuration RelWithDebInfo
- name: 'Create build artifact'
if: ${{ success() && fromJSON(needs.config.outputs.create_artifacts) }}
run: |
CI/windows/03_package_obs.ps1 -BuildArch ${{ matrix.arch }} -Package
$ArtifactName = Get-ChildItem -filter "obs-studio-*-windows-${{ matrix.arch }}.zip" -File
.github/scripts/Package-Windows.ps1 -Target x64 -Configuration RelWithDebInfo
$ArtifactName = Get-ChildItem -filter "build_x64/obs-studio-*-windows-x64.zip" -File
Write-Output "FILE_NAME=${ArtifactName}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: 'Upload build artifact'
if: ${{ success() && fromJSON(needs.config.outputs.create_artifacts) }}
uses: actions/upload-artifact@v3
with:
name: 'obs-studio-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
name: 'obs-studio-windows-x64-${{ steps.setup.outputs.commitHash }}'
path: '${{ env.FILE_NAME }}'
linux_package:
@ -429,57 +392,6 @@ jobs:
restore-cache: ${{ fromJSON(steps.setup.outputs.cache_hit) }}
cache-key: ${{ steps.setup.outputs.cache_key }}
windows_package:
name: '03 - Windows Installer'
runs-on: [windows-latest]
needs: [windows_build]
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
env:
BUILD_FOR_DISTRIBUTION: 'ON'
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: Setup Environment
id: setup
run: |
$CommitHash = git rev-parse --short=9 HEAD
"commitHash=${CommitHash}" >> $env:GITHUB_OUTPUT
- name: 'Add msbuild to PATH'
uses: microsoft/setup-msbuild@v1.1
- name: 'Download 64-bit artifact'
uses: actions/download-artifact@v3
with:
name: 'obs-studio-windows-x64-${{ steps.setup.outputs.commitHash }}'
- name: 'Download 32-bit artifact'
uses: actions/download-artifact@v3
with:
name: 'obs-studio-windows-x86-${{ steps.setup.outputs.commitHash }}'
- name: 'Unpack Windows build artifacts'
id: unpack
run: |
if (!(Test-Path install_temp)) {
$null = New-Item -ItemType Directory -Force -Path install_temp
}
Expand-Archive -Path "$(Get-ChildItem -filter "obs-studio-*-windows-x86.zip" -File)" -DestinationPath install_temp
Expand-Archive -Path "$(Get-ChildItem -filter "obs-studio-*-windows-x64.zip" -File)" -Force -DestinationPath install_temp
CI/windows/03_package_obs.ps1 -CombinedArchs -Package
$ArtifactName = (Get-ChildItem -filter "obs-studio-*-windows-x86+x64.zip" -File).Name
"filename=${ArtifactName}" >> $env:GITHUB_OUTPUT
- name: 'Upload build artifact'
uses: actions/upload-artifact@v3
with:
name: 'obs-studio-windows-installer'
path: '${{ steps.unpack.outputs.filename }}'
macos_release:
name: '03 - macOS notarized image'
runs-on: [macos-12]