2021-04-28 23:19:35 +00:00
|
|
|
name: "CI Multiplatform Build"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
|
|
|
- '**.md'
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
windows:
|
2021-04-29 01:34:44 +00:00
|
|
|
name: 'Windows 32+64bit'
|
2021-04-28 23:19:35 +00:00
|
|
|
runs-on: [windows-latest]
|
|
|
|
if: contains(github.event.head_commit.message, '[skip ci]') != true
|
|
|
|
env:
|
2021-04-29 01:34:44 +00:00
|
|
|
QT_VERSION: '5.15.2'
|
|
|
|
WINDOWS_DEPS_VERSION: '2019'
|
|
|
|
CMAKE_GENERATOR: "Visual Studio 16 2019"
|
|
|
|
CMAKE_SYSTEM_VERSION: "10.0"
|
2021-04-28 23:19:35 +00:00
|
|
|
steps:
|
2021-04-29 01:34:44 +00:00
|
|
|
- name: 'Add msbuild to PATH'
|
|
|
|
uses: microsoft/setup-msbuild@v1.0.2
|
2021-04-28 23:19:35 +00:00
|
|
|
- name: 'Checkout'
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2021-04-29 01:34:44 +00:00
|
|
|
path: ${{ github.workspace }}/obs-websocket
|
2021-04-28 23:19:35 +00:00
|
|
|
submodules: 'recursive'
|
2021-04-29 01:34:44 +00:00
|
|
|
- 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'
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}/obs-studio
|
|
|
|
run: |
|
|
|
|
git fetch --prune --unshallow
|
2021-04-29 01:45:56 +00:00
|
|
|
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
|
2021-04-29 01:34:44 +00:00
|
|
|
- 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-websocket git info'
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}/obs-websocket
|
|
|
|
run: |
|
|
|
|
git fetch --prune --unshallow
|
2021-04-29 01:45:56 +00:00
|
|
|
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
|
2021-04-29 01:34:44 +00:00
|
|
|
- name: 'Install prerequisite: QT'
|
|
|
|
run: |
|
|
|
|
curl -kLO https://tt2468.net/dl/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'
|
|
|
|
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
|
2021-04-28 23:19:35 +00:00
|
|
|
uses: actions/cache@v2
|
2021-04-29 01:34:44 +00:00
|
|
|
env:
|
|
|
|
CACHE_NAME: 'build-cache-obs-32'
|
2021-04-28 23:19:35 +00:00
|
|
|
with:
|
2021-04-29 01:34:44 +00:00
|
|
|
path: ${{ github.workspace }}/obs-studio/build32
|
|
|
|
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
|
2021-04-28 23:19:35 +00:00
|
|
|
restore-keys: |
|
2021-04-29 01:34:44 +00:00
|
|
|
${{ 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
|
2021-04-28 23:19:35 +00:00
|
|
|
run: |
|
2021-04-29 01:34:44 +00:00
|
|
|
mkdir .\build32
|
|
|
|
cd .\build32
|
2021-04-29 01:55:41 +00:00
|
|
|
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES -DBUILD_BROWSER=OFF ..
|
2021-04-29 01:34:44 +00:00
|
|
|
- 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'
|
|
|
|
id: build-cache-obs-64
|
|
|
|
uses: actions/cache@v1
|
|
|
|
env:
|
|
|
|
CACHE_NAME: 'build-cache-obs-64'
|
2021-04-29 00:37:08 +00:00
|
|
|
with:
|
2021-04-29 01:34:44 +00:00
|
|
|
path: ${{ github.workspace }}/obs-studio/build64
|
|
|
|
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
|
2021-04-29 00:37:08 +00:00
|
|
|
restore-keys: |
|
2021-04-29 01:34:44 +00:00
|
|
|
${{ runner.os }}-${{ env.CACHE_NAME }}-
|
|
|
|
- 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
|
2021-04-29 01:55:41 +00:00
|
|
|
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES -DBUILD_BROWSER=OFF ..
|
2021-04-29 01:34:44 +00:00
|
|
|
- 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-websocket 32-bit'
|
|
|
|
working-directory: ${{ github.workspace }}/obs-websocket
|
|
|
|
run: |
|
|
|
|
mkdir .\build32
|
|
|
|
cd .\build32
|
2021-04-29 01:49:44 +00:00
|
|
|
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019" -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" ..
|
2021-04-29 01:34:44 +00:00
|
|
|
- name: 'Configure obs-websocket 64-bit'
|
|
|
|
working-directory: ${{ github.workspace }}/obs-websocket
|
2021-04-29 00:37:08 +00:00
|
|
|
run: |
|
2021-04-29 01:34:44 +00:00
|
|
|
mkdir .\build64
|
|
|
|
cd .\build64
|
2021-04-29 01:49:44 +00:00
|
|
|
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019_64" -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" ..
|
2021-04-29 01:34:44 +00:00
|
|
|
- name: 'Build obs-websocket 32-bit'
|
|
|
|
working-directory: ${{ github.workspace }}/obs-websocket
|
|
|
|
run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-websocket.sln
|
|
|
|
- name: 'Build obs-websocket 64-bit'
|
|
|
|
working-directory: ${{ github.workspace }}/obs-websocket
|
|
|
|
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-websocket.sln
|
|
|
|
- name: 'Set PR artifact filename'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
FILENAME="obs-websocket-${{ env.GIT_HASH }}-Windows"
|
2021-04-29 01:45:56 +00:00
|
|
|
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
|
2021-04-29 01:34:44 +00:00
|
|
|
- name: 'Package obs-websocket'
|
|
|
|
working-directory: ${{ github.workspace }}/obs-websocket
|
|
|
|
run: |
|
|
|
|
mkdir package
|
|
|
|
cd package
|
|
|
|
7z a "${{ env.WIN_FILENAME }}.zip" "..\release\*"
|
2021-04-29 02:05:58 +00:00
|
|
|
iscc ..\installer\installer-windows.generated.iss /O. /F"${{ env.WIN_FILENAME }}-Installer"
|
2021-04-29 01:34:44 +00:00
|
|
|
- name: 'Publish ${{ env.WIN_FILENAME }}.zip'
|
|
|
|
if: success()
|
|
|
|
uses: actions/upload-artifact@v2-preview
|
|
|
|
with:
|
|
|
|
name: '${{ env.GIT_HASH }}-Windows'
|
|
|
|
path: ${{ github.workspace }}/obs-websocket/package/*.zip
|
|
|
|
- name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe'
|
|
|
|
if: success()
|
|
|
|
uses: actions/upload-artifact@v2-preview
|
|
|
|
with:
|
|
|
|
name: '${{ env.GIT_HASH }}-Windows-Installer'
|
|
|
|
path: ${{ github.workspace }}/obs-websocket/package/*.exe
|