Skip to content

Commit

Permalink
Update github workflow matrix with vgui and features options
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed May 10, 2024
1 parent 0ffeea3 commit a534bd6
Showing 1 changed file with 14 additions and 33 deletions.
47 changes: 14 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
vgui_build: [OFF, ON]
matrix:
include:
- os: ubuntu-latest
Expand All @@ -20,6 +21,8 @@ jobs:
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
include_features: "false"
fgd_name: "halflife_featureful.fgd"
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -52,29 +55,17 @@ jobs:
- name: Build on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist"
schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=${{ matrix.vgui_build }} -DCMAKE_INSTALL_PREFIX="$PWD/dist"
schroot --chroot steamrt_scout_i386 -- cmake --build build --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build --target install
- name: Build on Linux with vgui
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui"
cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install
- name: Add msbuild to PATH
if: startsWith(matrix.os, 'windows')
uses: microsoft/[email protected]
- name: Build on Windows
if: startsWith(matrix.os, 'windows')
run: |
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist"
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
- name: Build on Windows with vgui
if: startsWith(matrix.os, 'windows')
run: |
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui"
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=${{ matrix.vgui_build }} -DCMAKE_INSTALL_PREFIX="dist"
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
- name: Extract branch name
Expand All @@ -85,42 +76,32 @@ jobs:
shell: bash
run: echo "gamedir=$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" >> $GITHUB_OUTPUT
id: extract_gamedir

- name: Copy fgd to dist dir
if: ${{ (startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc')) || startsWith(matrix.os, 'windows') }}
run: |
cp fgd/halflife.fgd dist/${{ steps.extract_gamedir.outputs.gamedir }}/halflife_featureful.fgd
cp fgd/halflife.fgd dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}/halflife_featureful.fgd
cp -r features/ dist/${{ steps.extract_gamedir.outputs.gamedir }}/
cp -r features/ dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}/
run: cp fgd/halflife.fgd dist/${{ steps.extract_gamedir.outputs.gamedir }}/${{ env.fgd_name }}

- name: Copy features to dist dir
if: ${{ env.include_features == 'true' }}
run: cp -r features/ dist/${{ steps.extract_gamedir.outputs.gamedir }}/

- name: Delete .lib files from dist
if: startsWith(matrix.os, 'windows')
run: |
Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/cl_dlls/client.lib
Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/hl.lib
Remove-Item -Force -Path dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}/cl_dlls/client.lib
Remove-Item -Force -Path dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/hl.lib
- name: Upload linux artifact
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
uses: actions/upload-artifact@v3
with:
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux
path: dist/${{ steps.extract_gamedir.outputs.gamedir }}
- name: Upload linux artifact with vgui
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
uses: actions/upload-artifact@v3
with:
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux-vgui
path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}

- name: Upload windows artifact
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v3
with:
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows
path: dist/${{ steps.extract_gamedir.outputs.gamedir }}
- name: Upload windows artifact with vgui
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v3
with:
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows-vgui
path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}

0 comments on commit a534bd6

Please sign in to comment.