forked from FWGS/hlsdk-portable
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update github workflow matrix with vgui and features options
- Loading branch information
Showing
1 changed file
with
14 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ jobs: | |
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
vgui_build: [OFF, ON] | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 }} | ||
|