2021-06-06 21:15:36 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2021-06-07 23:05:47 +02:00
|
|
|
- os: ubuntu-latest
|
|
|
|
cc: gcc
|
|
|
|
cxx: g++
|
|
|
|
- os: ubuntu-latest
|
|
|
|
cc: clang
|
|
|
|
cxx: clang++
|
2021-12-02 00:19:12 +01:00
|
|
|
- os: windows-2019
|
2021-06-18 04:39:58 +02:00
|
|
|
cc: cl
|
|
|
|
cxx: cl
|
2021-06-06 21:15:36 +02:00
|
|
|
env:
|
2021-06-07 23:05:47 +02:00
|
|
|
CC: ${{ matrix.cc }}
|
|
|
|
CXX: ${{ matrix.cxx }}
|
2021-06-06 21:15:36 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-08-18 18:00:47 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-10-27 03:35:11 +02:00
|
|
|
with:
|
2022-06-18 03:55:40 +02:00
|
|
|
submodules: recursive
|
2021-06-07 23:05:47 +02:00
|
|
|
|
2021-06-18 04:39:58 +02:00
|
|
|
- name: Checkout steam-runtime
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2024-08-18 18:00:47 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-06-07 23:05:47 +02:00
|
|
|
with:
|
2021-06-18 04:39:58 +02:00
|
|
|
repository: ValveSoftware/steam-runtime
|
|
|
|
path: steam-runtime
|
|
|
|
- name: Cache steam-runtime
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
id: cache-steam-runtime
|
2024-08-18 18:00:47 +02:00
|
|
|
uses: actions/cache@v4
|
2021-06-18 04:39:58 +02:00
|
|
|
with:
|
|
|
|
path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
|
|
|
|
key: ${{ runner.os }}-steam-runtime
|
|
|
|
- name: Download steam-runtime
|
|
|
|
if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true'
|
|
|
|
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
|
|
|
|
- name: Install steam runtime
|
2021-06-07 23:05:47 +02:00
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
2021-10-21 18:55:42 +02:00
|
|
|
sudo apt update
|
2021-06-18 04:39:58 +02:00
|
|
|
./steam-runtime/setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
|
|
|
|
sudo sed -i 's/groups=sudo/groups=adm/g' /etc/schroot/chroot.d/steamrt_scout_i386.conf
|
2021-06-07 23:05:47 +02:00
|
|
|
|
2022-07-09 22:35:57 +02:00
|
|
|
- name: Build on Linux
|
2021-06-18 04:39:58 +02:00
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2021-06-06 21:15:36 +02:00
|
|
|
run: |
|
2024-01-15 07:35:13 +01:00
|
|
|
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"
|
2021-06-18 04:39:58 +02:00
|
|
|
schroot --chroot steamrt_scout_i386 -- cmake --build build --target all
|
|
|
|
schroot --chroot steamrt_scout_i386 -- cmake --build build --target install
|
2022-07-09 22:35:57 +02:00
|
|
|
- name: Build on Linux with vgui
|
2021-10-27 03:35:11 +02:00
|
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc')
|
|
|
|
run: |
|
2024-01-15 07:35:13 +01:00
|
|
|
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"
|
2022-06-18 03:55:40 +02:00
|
|
|
cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll
|
2021-10-27 03:35:11 +02:00
|
|
|
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all
|
|
|
|
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install
|
2021-06-07 23:05:47 +02:00
|
|
|
|
2021-06-18 04:39:58 +02:00
|
|
|
- name: Add msbuild to PATH
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2024-08-18 18:00:47 +02:00
|
|
|
uses: microsoft/setup-msbuild@v2
|
2022-07-09 22:35:57 +02:00
|
|
|
- name: Build on Windows
|
2021-06-18 04:39:58 +02:00
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: |
|
2022-07-09 22:35:57 +02:00
|
|
|
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist"
|
2021-08-27 10:04:15 +02:00
|
|
|
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
|
2022-07-09 22:35:57 +02:00
|
|
|
- name: Build on Windows with vgui
|
2021-10-27 03:35:11 +02:00
|
|
|
if: startsWith(matrix.os, 'windows')
|
|
|
|
run: |
|
2022-07-09 22:35:57 +02:00
|
|
|
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui"
|
2021-10-27 03:35:11 +02:00
|
|
|
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
|
2021-06-18 04:39:58 +02:00
|
|
|
|
|
|
|
- name: Extract branch name
|
|
|
|
shell: bash
|
2022-10-23 15:38:28 +02:00
|
|
|
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')" >> $GITHUB_OUTPUT
|
2021-06-18 04:39:58 +02:00
|
|
|
id: extract_branch
|
|
|
|
- name: Extract gamedir
|
|
|
|
shell: bash
|
2022-10-23 15:38:28 +02:00
|
|
|
run: echo "gamedir=$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" >> $GITHUB_OUTPUT
|
2021-06-18 04:39:58 +02:00
|
|
|
id: extract_gamedir
|
|
|
|
- name: Upload linux artifact
|
|
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
|
2024-08-18 18:00:47 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-06-18 04:39:58 +02:00
|
|
|
with:
|
|
|
|
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux
|
|
|
|
path: dist/${{ steps.extract_gamedir.outputs.gamedir }}
|
2021-10-27 03:35:11 +02:00
|
|
|
- name: Upload linux artifact with vgui
|
|
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
|
2024-08-18 18:00:47 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-10-27 03:35:11 +02:00
|
|
|
with:
|
|
|
|
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux-vgui
|
|
|
|
path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}
|
2021-06-18 04:39:58 +02:00
|
|
|
- name: Upload windows artifact
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2024-08-18 18:00:47 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-06-18 04:39:58 +02:00
|
|
|
with:
|
|
|
|
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows
|
|
|
|
path: dist/${{ steps.extract_gamedir.outputs.gamedir }}
|
2021-10-27 03:35:11 +02:00
|
|
|
- name: Upload windows artifact with vgui
|
|
|
|
if: startsWith(matrix.os, 'windows')
|
2024-08-18 18:00:47 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-10-27 03:35:11 +02:00
|
|
|
with:
|
|
|
|
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows-vgui
|
|
|
|
path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}
|
2021-06-18 04:39:58 +02:00
|
|
|
|