Skip to content

rename struct Color to RGBColor #127

rename struct Color to RGBColor

rename struct Color to RGBColor #127

Workflow file for this run

name: build
on:
push:
branches:
- master
jobs:
android:
name: Android
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Build Android
run: ./gradlew assembleDebug
working-directory: android
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Client-Mod-android
path: android/app/build/outputs/apk/debug/app-debug.apk
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
cc: gcc
cxx: g++
- os: ubuntu-latest
cc: clang
cxx: clang++
- os: windows-2019
cc: cl
cxx: cl
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install development tools
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install cmake build-essential gcc-multilib g++-multilib libsdl2-dev:i386
- name: Build on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
cmake -B build -S . -DBUILD_DISCORD_RPC=ON -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist"
cmake --build build --target all
cmake --build build --target install
- name: Build on Linux with vgui
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc')
run: |
cmake -B build-vgui -S . -DUSE_VGUI=ON -DBUILD_DISCORD_RPC=ON -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui"
cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll
cmake --build build-vgui --target all
cmake --build build-vgui --target install
- name: Add msbuild to PATH
if: startsWith(matrix.os, 'windows')
uses: microsoft/setup-msbuild@v1.1
- name: Build on Windows
if: startsWith(matrix.os, 'windows')
run: |
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DBUILD_DISCORD_RPC=ON -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 -DBUILD_DISCORD_RPC=ON -DCMAKE_INSTALL_PREFIX="dist-vgui"
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')" >> $GITHUB_OUTPUT
id: extract_branch
- name: Extract gamedir
shell: bash
run: echo "gamedir=$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" >> $GITHUB_OUTPUT
id: extract_gamedir
- name: Upload linux artifact
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
uses: actions/upload-artifact@v3
with:
name: Client-Mod-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: Client-Mod-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: Client-Mod-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: Client-Mod-windows-vgui
path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }}
release:
name: Release
runs-on: ubuntu-latest
needs: [android, build]
steps:
- name: Fetch artifacts
uses: actions/download-artifact@v3.0.1
with:
path: artifacts
- name: Remove old release
uses: dev-drprasad/delete-tag-and-release@v1.0
with:
tag_name: continuous
delete_release: true
github_token: ${{ secrets.GITHUB_TOKEN }}
repo: Elinsrc/Client-Mod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Repackage binaries
run: |
cd artifacts/
zip -j Client-Mod-android.zip Client-Mod-android/app-debug.apk
zip -j Client-Mod-linux.zip Client-Mod-linux/cl_dlls/client.so
zip -j Client-Mod-linux-vgui.zip Client-Mod-linux-vgui/cl_dlls/client.so
zip -j Client-Mod-windows.zip Client-Mod-windows/cl_dlls/client.dll
zip -j Client-Mod-windows-vgui.zip Client-Mod-windows-vgui/cl_dlls/client.dll
ls -R .
cd ../
sleep 60s
- name: Upload new release
uses: svenstaro/upload-release-action@v2
with:
repo_name: Elinsrc/Client-Mod
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: artifacts/*.zip
tag: continuous
overwrite: true
prerelease: true
release_name: Client-Mod continuous build