You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
4.6 KiB
113 lines
4.6 KiB
4 years ago
|
name: build
|
||
|
|
||
|
on: [push, pull_request]
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ${{ matrix.os }}
|
||
|
strategy:
|
||
|
matrix:
|
||
|
include:
|
||
4 years ago
|
- os: ubuntu-latest
|
||
|
cc: gcc
|
||
|
cxx: g++
|
||
|
- os: ubuntu-latest
|
||
|
cc: clang
|
||
|
cxx: clang++
|
||
3 years ago
|
- os: windows-2019
|
||
4 years ago
|
cc: cl
|
||
|
cxx: cl
|
||
4 years ago
|
env:
|
||
4 years ago
|
CC: ${{ matrix.cc }}
|
||
|
CXX: ${{ matrix.cxx }}
|
||
4 years ago
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
3 years ago
|
with:
|
||
3 years ago
|
submodules: recursive
|
||
4 years ago
|
|
||
4 years ago
|
- name: Checkout steam-runtime
|
||
|
if: startsWith(matrix.os, 'ubuntu')
|
||
4 years ago
|
uses: actions/checkout@v2
|
||
|
with:
|
||
4 years ago
|
repository: ValveSoftware/steam-runtime
|
||
|
path: steam-runtime
|
||
|
- name: Cache steam-runtime
|
||
|
if: startsWith(matrix.os, 'ubuntu')
|
||
|
id: cache-steam-runtime
|
||
|
uses: actions/cache@v2
|
||
|
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
|
||
4 years ago
|
if: startsWith(matrix.os, 'ubuntu')
|
||
|
run: |
|
||
3 years ago
|
sudo apt update
|
||
4 years ago
|
./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
|
||
4 years ago
|
|
||
3 years ago
|
- name: Build on Linux
|
||
4 years ago
|
if: startsWith(matrix.os, 'ubuntu')
|
||
4 years ago
|
run: |
|
||
3 years ago
|
schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist"
|
||
4 years ago
|
schroot --chroot steamrt_scout_i386 -- cmake --build build --target all
|
||
|
schroot --chroot steamrt_scout_i386 -- cmake --build build --target install
|
||
3 years ago
|
- name: Build on Linux with vgui
|
||
3 years ago
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc')
|
||
|
run: |
|
||
3 years ago
|
schroot --chroot steamrt_scout_i386 -- cmake -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui"
|
||
3 years ago
|
cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll
|
||
3 years ago
|
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all
|
||
|
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install
|
||
4 years ago
|
|
||
4 years ago
|
- name: Add msbuild to PATH
|
||
|
if: startsWith(matrix.os, 'windows')
|
||
|
uses: microsoft/setup-msbuild@v1.0.2
|
||
3 years ago
|
- name: Build on Windows
|
||
4 years ago
|
if: startsWith(matrix.os, 'windows')
|
||
|
run: |
|
||
3 years ago
|
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist"
|
||
3 years ago
|
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
|
||
3 years ago
|
- name: Build on Windows with vgui
|
||
3 years ago
|
if: startsWith(matrix.os, 'windows')
|
||
|
run: |
|
||
3 years ago
|
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui"
|
||
3 years ago
|
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
|
||
4 years ago
|
|
||
|
- name: Extract branch name
|
||
|
shell: bash
|
||
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')"
|
||
|
id: extract_branch
|
||
|
- name: Extract gamedir
|
||
|
shell: bash
|
||
|
run: echo "##[set-output name=gamedir;]$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)"
|
||
|
id: extract_gamedir
|
||
|
- name: Upload linux artifact
|
||
|
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
|
||
|
uses: actions/upload-artifact@v2
|
||
|
with:
|
||
|
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux
|
||
|
path: dist/${{ steps.extract_gamedir.outputs.gamedir }}
|
||
3 years ago
|
- name: Upload linux artifact with vgui
|
||
|
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
|
||
|
uses: actions/upload-artifact@v2
|
||
|
with:
|
||
|
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux-vgui
|
||
|
path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}
|
||
4 years ago
|
- name: Upload windows artifact
|
||
|
if: startsWith(matrix.os, 'windows')
|
||
|
uses: actions/upload-artifact@v2
|
||
|
with:
|
||
|
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows
|
||
|
path: dist/${{ steps.extract_gamedir.outputs.gamedir }}
|
||
3 years ago
|
- name: Upload windows artifact with vgui
|
||
|
if: startsWith(matrix.os, 'windows')
|
||
|
uses: actions/upload-artifact@v2
|
||
|
with:
|
||
|
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows-vgui
|
||
|
path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}
|
||
4 years ago
|
|