Skip to content

Commit

Permalink
Changes from Avasam for OBD 29.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kaymyst committed May 26, 2023
1 parent 907afb6 commit d156f41
Show file tree
Hide file tree
Showing 36 changed files with 328 additions and 524 deletions.
132 changes: 49 additions & 83 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,173 +1,139 @@
name: 'CI Windows On-Push'
name: "CI Windows On-Push"

on:
workflow_dispatch: # Allows manual builds
push:
branches:
- master
pull_request:
branches:
- master

jobs:
windows:
name: 'Windows 32+64bit'
runs-on: [windows-2019]
name: "Windows 64bit"
runs-on: windows-latest
env:
QT_VERSION: '5.10.1'
WINDOWS_DEPS_VERSION: '2019'
CMAKE_GENERATOR: "Visual Studio 16 2019"
OBS_DEPS: "2023-04-12"
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_SYSTEM_VERSION: "10.0"
# TODO: Don't ACTIONS_ALLOW_UNSECURE_COMMANDS
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: 'Add msbuild to PATH'
uses: microsoft/[email protected].2
- name: 'Checkout'
- name: "Add msbuild to PATH"
uses: microsoft/[email protected].0
- name: "Checkout"
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-virtual-cam
submodules: 'recursive'
- name: 'Checkout OBS'
submodules: "recursive"
- name: "Checkout OBS"
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
- name: 'Get OBS-Studio git info'
submodules: "recursive"
- name: "Get OBS-Studio git info"
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD)
echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0)
- name: "Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})"
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: 'Get obs-virtual-cam git info'
- name: "Get obs-virtual-cam git info"
shell: bash
working-directory: ${{ github.workspace }}/obs-virtual-cam
run: |
git fetch --prune --unshallow
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: 'Install prerequisite: QT'
echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}
echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0)
- name: "Install prerequisite: QT"
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C -
7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT"
- name: 'Install prerequisite: Pre-built OBS dependencies'
curl -kLO https://github.com/obsproject/obs-deps/releases/download/${{ env.OBS_DEPS }}/windows-deps-qt6-${{ env.OBS_DEPS }}-x64.zip -f --retry 5 -C -
7z x windows-deps-qt6-${{ env.OBS_DEPS }}-x64.zip -o"${{ github.workspace }}\cmbuild\QT"
- name: "Install prerequisite: Pre-built OBS dependencies"
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C -
7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}\cmbuild\deps"
- name: 'Restore OBS 32-bit build v${{ env.OBS_GIT_TAG }} from cache'
id: build-cache-obs-32
uses: actions/cache@v1
env:
CACHE_NAME: 'build-cache-obs-32'
with:
path: ${{ github.workspace }}/obs-studio/build32
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_NAME }}-
- name: 'Configure OBS 32-bit'
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
mkdir .\build32
cd .\build32
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DDISABLE_PLUGINS=TRUE -DCOPY_DEPENDENCIES=YES ..
- name: 'Build OBS-Studio 32-bit'
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
msbuild /m /p:Configuration=RelWithDebInfo .\build32\libobs\libobs.vcxproj
msbuild /m /p:Configuration=RelWithDebInfo .\build32\UI\obs-frontend-api\obs-frontend-api.vcxproj
- name: 'Restore OBS 64-bit build v${{ env.OBS_GIT_TAG }} from cache'
curl -kLO https://github.com/obsproject/obs-deps/releases/download/${{ env.OBS_DEPS }}/windows-deps-${{ env.OBS_DEPS }}-x64.zip -f --retry 5 -C -
7z x windows-deps-${{ env.OBS_DEPS }}-x64.zip -o"${{ github.workspace }}\cmbuild\deps"
- name: "Restore OBS 64-bit build v${{ env.OBS_GIT_TAG }} from cache"
id: build-cache-obs-64
uses: actions/cache@v1
env:
CACHE_NAME: 'build-cache-obs-64'
CACHE_NAME: "build-cache-obs-64"
with:
path: ${{ github.workspace }}/obs-studio/build64
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_NAME }}-
- name: 'Configure OBS 64-bit'
- name: "Configure OBS 64-bit"
if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
mkdir .\build64
cd .\build64
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DDISABLE_PLUGINS=TRUE -DCOPY_DEPENDENCIES=YES ..
- name: 'Build OBS-Studio 64-bit'
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT" -DDepsPath="${{ github.workspace }}\cmbuild\deps" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES ..
- name: "Build OBS-Studio 64-bit"
if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
msbuild /m /p:Configuration=RelWithDebInfo .\build64\libobs\libobs.vcxproj
msbuild /m /p:Configuration=RelWithDebInfo .\build64\UI\obs-frontend-api\obs-frontend-api.vcxproj
- name: 'Configure obs-virtual-cam 64-bit'
- name: "Configure obs-virtual-cam 64-bit"
working-directory: ${{ github.workspace }}/obs-virtual-cam
run: |
mkdir .\build64
cd .\build64
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build64\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build64\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" -DPTHREAD_LIB="${{ github.workspace }}\obs-studio\build64\deps\w32-pthreads\RelWithDebInfo\w32-pthreads.lib" ..
- name: 'Configure obs-virtual-cam 32-bit'
working-directory: ${{ github.workspace }}/obs-virtual-cam
run: |
mkdir .\build32
cd .\build32
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build32\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build32\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" -DPTHREAD_LIB="${{ github.workspace }}\obs-studio\build32\deps\w32-pthreads\RelWithDebInfo\w32-pthreads.lib" ..
- name: 'Build obs-virtual-cam 64-bit'
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT" -DDepsPath="${{ github.workspace }}\cmbuild\deps" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build64\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build64\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" -DPTHREAD_LIB="${{ github.workspace }}\obs-studio\build64\deps\w32-pthreads\RelWithDebInfo\w32-pthreads.lib" ..
- name: "Build obs-virtual-cam 64-bit"
working-directory: ${{ github.workspace }}/obs-virtual-cam
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-virtualcam.sln
- name: 'Build obs-virtual-cam 32-bit'
working-directory: ${{ github.workspace }}/obs-virtual-cam
run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-virtualcam.sln
- name: 'Set release filename'

- name: "Set release filename"
shell: bash
run: |
FILENAME="OBS-Virtualcam-${{ env.GIT_TAG }}-Windows"
echo "WIN_FILENAME=$FILENAME" >> $GITHUB_ENV
- name: 'Package obs-virtual-cam'
echo "::set-env name=WIN_FILENAME::$FILENAME"
- name: "Package obs-virtual-cam"
working-directory: ${{ github.workspace }}/obs-virtual-cam
run: |
mkdir build-package\obs-plugins\64bit
mkdir build-package\obs-plugins\32bit
mkdir build-package\data\obs-plugins\obs-virtualoutput\locale\
mkdir build-package\bin\64bit
mkdir build-package\bin\32bit
robocopy ${{ github.workspace }}\cmbuild\deps\win32\bin\ .\build-package\bin\32bit\ avutil-56.dll swscale-5.dll
robocopy .\build64\src\virtual-output\RelWithDebInfo .\build-package\obs-plugins\64bit\ obs-virtualoutput.dll obs-virtualoutput.stripped.pdb
robocopy .\build64\src\virtual-source\RelWithDebInfo .\build-package\bin\64bit\ obs-virtualsource.dll obs-virtualsource.stripped.pdb
robocopy .\build32\src\virtual-output\RelWithDebInfo .\build-package\obs-plugins\32bit\ obs-virtualoutput.dll obs-virtualoutput.stripped.pdb
robocopy .\build32\src\virtual-source\RelWithDebInfo .\build-package\bin\32bit\ obs-virtualsource.dll obs-virtualsource.stripped.pdb
robocopy .\locale\ .\build-package\data\obs-plugins\obs-virtualoutput\locale\ *.ini
ren .\build-package\obs-plugins\64bit\obs-virtualoutput.stripped.pdb obs-virtualoutput.pdb
ren .\build-package\obs-plugins\32bit\obs-virtualoutput.stripped.pdb obs-virtualoutput.pdb
ren .\build-package\bin\64bit\obs-virtualsource.stripped.pdb obs-virtualsource.pdb
ren .\build-package\bin\32bit\obs-virtualsource.stripped.pdb obs-virtualsource.pdb
mkdir release
7z a ".\release\${{ env.WIN_FILENAME }}.zip" ".\build-package\*"
- name: Install NSIS
working-directory: ${{ github.workspace }}/obs-virtual-cam
run: |
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
scoop bucket add extras
scoop install nsis
- name: Build obs-virtualcam installer
working-directory: ${{ github.workspace }}/obs-virtual-cam
run: |
cd installer
makensis /DVERSION=${{ env.GIT_TAG }} installer.nsi
- name: 'Publish ${{ env.WIN_FILENAME }}.zip'
- name: "Publish ${{ env.WIN_FILENAME }}.zip"
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_TAG }}-Windows'
name: "${{ env.GIT_TAG }}-Windows"
path: ${{ github.workspace }}\obs-virtual-cam\release\*.zip
- name: 'Publish ${{ env.WIN_FILENAME }}-Windows-Installer.exe'
- name: "Publish ${{ env.WIN_FILENAME }}-Windows-Installer.exe"
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_TAG }}-Windows-Installer'
name: "${{ env.GIT_TAG }}-Windows-Installer"
path: ${{ github.workspace }}\obs-virtual-cam\build-package\*.exe
Loading

0 comments on commit d156f41

Please sign in to comment.