Skip to content

Update CMakeLists.txt #497

Update CMakeLists.txt

Update CMakeLists.txt #497

Workflow file for this run

name: Build
on: [push, workflow_dispatch]
jobs:
windows_build:
name: Windows build
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout repo
uses: actions/checkout@v1
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Cache vcpkg
uses: actions/cache@v2
with:
path: |
vcpkg
vcpkg_installed
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }}
- name: vcpkg
run: |
if(!(Test-Path .\vcpkg))
{
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
}
- name: cmake
run: cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 17 2022" -A x64 .
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: MSBuild
run: msbuild USC.sln -p:Configuration=Release /m /verbosity:minimal
- name: Tests
run: rm ./bin/Tests.*
- name: Get Symbols
continue-on-error: true
run: |
mkdir -f .\bin\crash_dumps\
cp .\third_party\breakpad
.\third_party\breakpad\dump_syms.exe .\bin\usc-game.pdb > .\bin\crash_dumps\usc-game.syms
mv .\bin\usc-game.pdb .\bin\crash_dumps\.
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: Game
path: bin
linux_build:
name: Linux build
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout repo
uses: actions/checkout@v1
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install g++ libegl1-mesa-dev libfreetype6-dev libogg-dev libvorbis-dev libsdl2-dev libarchive-dev zlib1g-dev libjpeg-dev libpng-dev
sudo add-apt-repository universe
sudo apt install libfuse2
- name: cmake
run: cmake -DCMAKE_BUILD_TYPE=Release -DUSC_GNU_WERROR=Off .
- name: make
run: make
- name: Prepare for bundling AppImage
run: |
sudo apt-get install appstream
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
- name: Bundle AppImage
run: |
./linuxdeploy-x86_64.AppImage --custom-apprun appimage/AppRun -d appimage/usc-game.desktop -i appimage/usc-game.png -e bin/usc-game --appdir usc-appdir --output appimage
mv usc-game*.AppImage bin/usc-game.AppImage
chmod +x bin/usc-game.AppImage
rm bin/usc-game bin/Tests.*
- name: Pack everything into .tar.gz archive
run: cd bin && tar -czvf ../Game_linux_AppImage.tar.gz *
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: Game_linux_AppImage
path: Game_linux_AppImage.tar.gz
macos_build:
name: macOS build
runs-on: macos-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout repo
uses: actions/checkout@v1
- name: Checkout submodules
run: git submodule update --init --recursive
- name: brew update
run: brew update
- name: Install packages
run: brew install freetype libvorbis sdl2 libpng jpeg-turbo libarchive
- name: cmake
env:
DCMAKE_BUILD_TYPE: Release
run: cmake .
- name: make
run: make
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: Game_mac
path: bin
distribution_trigger:
name: Artifact distribution trigger
runs-on: windows-latest
if: github.ref == 'refs/heads/master'
needs: [windows_build, linux_build, macos_build]
steps:
- name: Trigger artifact distribution
continue-on-error: true
run: |
Invoke-RestMethod -Method POST -ContentType "application/json" -Body '{ "id": ${{ github.run_id }}}' -Uri ${{ secrets.WEBHOOK_URL }}