mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
CI: Test the old gh actions script
This commit is contained in:
parent
89373827f0
commit
3ae8c1a8fb
163
.github/workflows/main.yml
vendored
163
.github/workflows/main.yml
vendored
@ -15,54 +15,143 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
windows:
|
||||||
name: 'Windows 32/64 Bit'
|
name: 'Windows 32+64bit'
|
||||||
runs-on: [windows-latest]
|
runs-on: [windows-latest]
|
||||||
if: contains(github.event.head_commit.message, '[skip ci]') != true
|
if: contains(github.event.head_commit.message, '[skip ci]') != true
|
||||||
env:
|
env:
|
||||||
build_config: 'RelWithDebInfo'
|
QT_VERSION: '5.15.2'
|
||||||
DEPS_CACHE_VERSION: '3' # Change whenever updating OBS dependencies URL, in order to force a cache reset
|
WINDOWS_DEPS_VERSION: '2019'
|
||||||
DEPS_BASE_PATH: 'D:\obsdependencies'
|
CMAKE_GENERATOR: "Visual Studio 16 2019"
|
||||||
DEPS_PATH_32: 'D:\obsdependencies\win32'
|
CMAKE_SYSTEM_VERSION: "10.0"
|
||||||
DEPS_PATH_64: 'D:\obsdependencies\win64'
|
|
||||||
QT_CACHE_VERSION: '4' # Change whenever updating Qt dependency URL, in order to force a cache reset
|
|
||||||
QT_BASE_DIR: 'D:\QtDep'
|
|
||||||
QTDIR32: 'D:\QtDep\5.15.2\msvc2019'
|
|
||||||
QTDIR64: 'D:\QtDep\5.15.2\msvc2019_64'
|
|
||||||
OBS_PATH: 'D:\obs-studio'
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: 'Add msbuild to PATH'
|
||||||
|
uses: microsoft/setup-msbuild@v1.0.2
|
||||||
- name: 'Checkout'
|
- name: 'Checkout'
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
path: ${{ github.workspace }}/obs-websocket
|
||||||
submodules: 'recursive'
|
submodules: 'recursive'
|
||||||
- name: 'Restore cached Qt archive file'
|
- name: 'Checkout OBS'
|
||||||
id: qtcache
|
uses: actions/checkout@v2
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: ${{ env.QT_BASE_DIR }}\**
|
repository: obsproject/obs-studio
|
||||||
key: 'qtdep-${{ env.QT_CACHE_VERSION }} | ${{ runner.os }}'
|
path: ${{ github.workspace }}/obs-studio
|
||||||
restore-keys: |
|
submodules: 'recursive'
|
||||||
qtdep-${{ env.QT_CACHE_VERSION }} | ${{ runner.os }}
|
- name: 'Get OBS-Studio git info'
|
||||||
- name: 'Download and Extract Qt'
|
shell: bash
|
||||||
if: steps.qtcache.outputs.cache-hit != 'true'
|
working-directory: ${{ github.workspace }}/obs-studio
|
||||||
run: |
|
run: |
|
||||||
mkdir ${{ env.QT_BASE_DIR }}
|
git fetch --prune --unshallow
|
||||||
cd D:\
|
echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD)
|
||||||
curl -kLO https://tt2468.net/dl/Qt_5.15.2.7z -f --retry 5 -C -
|
echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD)
|
||||||
7z x Qt_5.15.2.7z -o${{ env.QT_BASE_DIR }}
|
echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0)
|
||||||
dir ${{ env.QT_BASE_DIR }}
|
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
|
||||||
- name: 'Restore cached OBS Studio dependencies'
|
shell: bash
|
||||||
id: obscache
|
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
|
||||||
|
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://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
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
CACHE_NAME: 'build-cache-obs-32'
|
||||||
with:
|
with:
|
||||||
path: ${{ env.DEPS_BASE_PATH }}\**
|
path: ${{ github.workspace }}/obs-studio/build32
|
||||||
key: 'obsdep-${{ env.DEPS_CACHE_VERSION }} | ${{ runner.os }}'
|
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
obsdep-${{ env.DEPS_CACHE_VERSION }} | ${{ runner.os }}
|
${{ runner.os }}-${{ env.CACHE_NAME }}-
|
||||||
- name: 'Download and Extract deps'
|
- name: 'Configure OBS 32-bit'
|
||||||
if: steps.obscache.outputs.cache-hit != 'true'
|
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
|
||||||
|
working-directory: ${{ github.workspace }}/obs-studio
|
||||||
run: |
|
run: |
|
||||||
mkdir ${{ env.DEPS_BASE_PATH }}
|
mkdir .\build32
|
||||||
cd D:\
|
cd .\build32
|
||||||
curl -o dependencies.zip -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2019.zip -f --retry 5 -C -
|
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" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES ..
|
||||||
7z x dependencies.zip -o${{ env.DEPS_BASE_PATH }}
|
- name: 'Build OBS-Studio 32-bit'
|
||||||
dir ${{ env.DEPS_BASE_PATH }}
|
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'
|
||||||
|
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'
|
||||||
|
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" -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-websocket 32-bit'
|
||||||
|
working-directory: ${{ github.workspace }}/obs-websocket
|
||||||
|
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" -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" ..
|
||||||
|
- name: 'Configure obs-websocket 64-bit'
|
||||||
|
working-directory: ${{ github.workspace }}/obs-websocket
|
||||||
|
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" -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" ..
|
||||||
|
- 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"
|
||||||
|
echo "::set-env name=FILENAME::$FILENAME"
|
||||||
|
- name: 'Package obs-websocket'
|
||||||
|
working-directory: ${{ github.workspace }}/obs-websocket
|
||||||
|
run: |
|
||||||
|
mkdir package
|
||||||
|
cd package
|
||||||
|
7z a "${{ env.WIN_FILENAME }}.zip" "..\release\*"
|
||||||
|
iscc ..\installer\installer.iss /O. /F"${{ env.WIN_FILENAME }}-Installer"
|
||||||
|
- 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
|
Loading…
Reference in New Issue
Block a user