Bump jurplel/install-qt-action from 3 to 4 #112
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows-Build | |
on: | |
pull_request: | |
push: | |
paths-ignore: | |
- '.github/workflows/linux-build.yml' | |
- '.gitignore' | |
- 'LICENSE' | |
- 'README.md' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest] | |
arch: [x64] | |
mode: [debug, releasedbg] | |
runs-on: ${{ matrix.os }} | |
if: "!contains(github.event.head_commit.message, 'ci skip')" | |
env: | |
QT_VERSION: '5.15.2' | |
OBS_VERSION: '26.0.0' | |
CMAKE_GENERATOR: 'Visual Studio 17 2022' | |
steps: | |
- name: Get current date as package key | |
id: pkg_key | |
run: echo "::set-output name=key::$(date +'%W')" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Checkout Kinect SDKs | |
uses: actions/checkout@v4 | |
continue-on-error: true | |
with: | |
repository: SirLynix/kinect-sdks | |
token: ${{ secrets.KINECT_SDKS_PAT }} | |
path: ${{ github.workspace }}/kinect-sdks | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2.0.0 | |
- name: Enable longpath in git for Windows | |
run: git config --system core.longpaths true | |
# Install Qt | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{ env.QT_VERSION }} | |
# Select OBS runtime | |
- name: Choose OBS Debug or Release build | |
uses: haya14busa/action-cond@v1 | |
id: cmake_target | |
with: | |
cond: ${{ matrix.mode == 'debug' }} | |
if_true: "Debug" | |
if_false: "RelWithDebInfo" | |
# Cache OBS Studio | |
- name: Retrieve OBS Studio cache | |
uses: actions/cache@v3 | |
id: obs-cache | |
with: | |
path: ${{ github.workspace }}/obs-studio | |
key: Windows-OBS-Studio-${{ steps.cmake_target.outputs.value }}-${{ env.OBS_VERSION }} | |
# Build obs-studio | |
- name: Clone OBS | |
if: steps.obs-cache.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: obsproject/obs-studio | |
path: ${{ github.workspace }}/obs-studio | |
submodules: 'recursive' | |
fetch-depth: 0 # for tags | |
# Checkout OBS to the wanted version | |
- name: Checkout OBS-Studio release (${{ env.OBS_VERSION }}) | |
if: steps.obs-cache.outputs.cache-hit != 'true' | |
working-directory: ${{ github.workspace }}/obs-studio | |
run: | | |
git checkout ${{ env.OBS_VERSION }} | |
git submodule update | |
# Install OBS dependencies | |
- name: Install OBS dependencies | |
if: steps.obs-cache.outputs.cache-hit != 'true' | |
working-directory: ${{ github.workspace }} | |
run: | | |
curl https://obsproject.com/downloads/dependencies2019.zip --output dependencies2019.zip | |
mkdir obsdeps | |
tar -xv -C obsdeps -f dependencies2019.zip | |
# Configure and build obs | |
- name: Build OBS-Studio | |
if: steps.obs-cache.outputs.cache-hit != 'true' | |
working-directory: ${{ github.workspace }}/obs-studio | |
run: | | |
mkdir ./build64 | |
cd ./build64 | |
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DDepsPath=${{ github.workspace }}\obsdeps\win64 -DQTDIR=${{ env.Qt5_DIR }} -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO .. | |
msbuild /m /p:Configuration=${{ steps.cmake_target.outputs.value }} ./libobs/libobs.vcxproj | |
# Force xmake to a specific folder (for cache) | |
- name: Set xmake env | |
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
# Install xmake | |
- name: Setup xmake | |
uses: xmake-io/github-action-setup-xmake@v1 | |
with: | |
xmake-version: branch@dev # avoids a bug in xmake 2.9.1 | |
# Prepare environment | |
- name: Configure build | |
run: | |
echo "LibObs = { Include = [[${{ github.workspace }}\obs-studio\libobs]], Lib64 = [[${{ github.workspace }}\obs-studio\build64\libobs]] } ObsPlugins={}" > config.lua | |
# Update xmake repository (in order to have the file that will be cached) | |
- name: Update xmake repository | |
run: xmake repo --update | |
# Fetch xmake dephash | |
- name: Retrieve dependencies hash | |
id: dep_hash | |
run: echo "::set-output name=hash::$(xmake l utils.ci.packageskey)" | |
# Cache xmake dependencies | |
- name: Retrieve cached xmake dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages | |
key: MSVC-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.pkg_key.outputs.key }} | |
# Setup compilation mode and install project dependencies | |
- name: Configure xmake and install dependencies | |
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --yes --verbose | |
env: | |
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt | |
KINECTSDK10_DIR: ${{ github.workspace }}/kinect-sdks/sdk1 | |
KINECT_TOOLKIT_DIR: ${{ github.workspace }}/kinect-sdks/sdk1-toolkit | |
KINECTSDK20_DIR: ${{ github.workspace }}/kinect-sdks/sdk2 | |
# Build the plugin | |
- name: Build obs-kinect | |
run: xmake --verbose | |
env: | |
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt | |
KINECTSDK10_DIR: ${{ github.workspace }}/kinect-sdks/sdk1 | |
KINECT_TOOLKIT_DIR: ${{ github.workspace }}/kinect-sdks/sdk1-toolkit | |
KINECTSDK20_DIR: ${{ github.workspace }}/kinect-sdks/sdk2 | |
# Install the result files | |
- name: Install obs-kinect | |
run: xmake package -vo package | |
env: | |
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt | |
KINECTSDK10_DIR: ${{ github.workspace }}/kinect-sdks/sdk1 | |
KINECT_TOOLKIT_DIR: ${{ github.workspace }}/kinect-sdks/sdk1-toolkit | |
KINECTSDK20_DIR: ${{ github.workspace }}/kinect-sdks/sdk2 | |
# Upload artifacts | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }} | |
path: package |