use the correct sniper located in common #63
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
name: build-linux | |
on: | |
push: | |
paths-ignore: | |
- 'schemas/**.json' | |
- 'staging/cfg/**.json' | |
- '*.md' | |
- '*.appinstaller_template' | |
env: | |
VCPKG_ROOT: ${{ github.workspace }}/submodules/vcpkg | |
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | |
VCPKG_FEATURE_FLAGS: manifests,binarycaching,registries | |
VCPKG_CACHE_VERSION: 9 | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
config: | |
runs-on: ubuntu-latest | |
outputs: | |
tf2bd_version: ${{ steps.tf2bd_version.outputs.value }} | |
tf2bd_workspace: ${{ steps.tf2bd_paths.outputs.workspace }} | |
tf2bd_build_dir: ${{ steps.tf2bd_paths.outputs.build_dir }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Extract TF2BD_VERSION | |
id: tf2bd_version | |
run: | | |
mkdir build_dir | |
cd build_dir | |
cmake -DCMAKE_TOOLCHAIN_FILE="" ../ || true # we know this will fail, we just need version info from CMakeCache.txt | |
TF2BD_VERSION_NOBUILD=`cat CMakeCache.txt | grep TF2BD_VERSION_NOBUILD: | cut -d "=" -f2` | |
echo "value=$TF2BD_VERSION_NOBUILD.${{ github.run_number }}" >> $GITHUB_OUTPUT | |
- name: Debug | |
run: | | |
echo "github.event_name = ${{ github.event_name }}" | |
echo "github.sha = ${{ github.sha }}" | |
echo "github.ref = ${{ github.ref }}" | |
echo "github.run_id = ${{ github.run_id }}" | |
echo "github.run_number = ${{ github.run_number }}" | |
- name: Config cross-platform paths | |
id: tf2bd_paths | |
run: | | |
tf2bd_workspace=`realpath "${{ github.workspace }}"` | |
echo "workspace=$tf2bd_workspace" >> $GITHUB_OUTPUT | |
echo "build_dir=$tf2bd_workspace/tf2bd_cmake_build_dir/" >> $GITHUB_OUTPUT | |
build: | |
needs: config | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest ] | |
triplet: [ x64-ubuntu ] | |
# discord_integration: [ false ] # fix soon lol | |
discord_integration: [true, false] | |
build_type: [ RelWithDebInfo, Release ] | |
include: | |
- os: ubuntu-latest | |
triplet: x64-ubuntu | |
tf2bd_arch: x64 | |
steps: | |
- name: Determine artifact behavior | |
id: determine_artifact_behavior | |
if: matrix.discord_integration == true | |
run: echo "upload=1" >> $GITHUB_OUTPUT | |
- name: Debug | |
run: | | |
echo "matrix.os = ${{ matrix.os }}" | |
echo "matrix.triplet = ${{ matrix.triplet }}" | |
echo "matrix.discord_integration = ${{ matrix.discord_integration }}" | |
echo "matrix.tf2bd_arch = ${{ matrix.tf2bd_arch }}" | |
echo "matrix.build_type = ${{ matrix.build_type }}" | |
echo "steps.determine_artifact_behavior.outputs.upload = ${{ steps.determine_artifact_behavior.outputs.upload }}" | |
echo "needs.config.outputs.tf2bd_version = ${{ needs.config.outputs.tf2bd_version }}" | |
echo "needs.config.outputs.tf2bd_workspace = ${{ needs.config.outputs.tf2bd_workspace }}" | |
echo "needs.config.outputs.tf2bd_build_dir = ${{ needs.config.outputs.tf2bd_build_dir }}" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Setup NuGet Credentials | |
run: > | |
nuget sources add | |
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
-storepasswordincleartext | |
-name "GitHub" | |
-username "${{ github.repository_owner }}" | |
-password "${{ secrets.GITHUB_TOKEN }}" | |
- uses: seanmiddleditch/gha-setup-ninja@v4 | |
- name: Configure build tools | |
run: "echo yea" | |
# we're technically getting cmake twice | |
# should be fine right | |
- uses: lukka/get-cmake@latest | |
- name: Add universe respository to apt | |
run: sudo add-apt-repository universe && sudo apt-get update | |
- name: Install Dependencies | |
run: sudo apt-get install -y --no-install-recommends libtbb-dev libgl-dev libegl-dev libglx-dev | |
gcc-11 g++-11 libsdl2-dev build-essential git make | |
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev | |
libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev | |
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev | |
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libglu1-mesa-dev libgles2-mesa-dev | |
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev | |
libpipewire-0.3-dev libwayland-dev libdecor-0-dev libxrender-dev | |
mesa-common-dev libxft-dev | |
- name: Install discord-game-sdk 3.2.1 | |
if: matrix.discord_integration == true | |
run: wget https://dl-game-sdk.discordapp.net/3.2.1/discord_game_sdk.zip && | |
mkdir discord_game_sdk && | |
unzip discord_game_sdk.zip -d discord_game_sdk && | |
sudo mv discord_game_sdk/lib/x86_64/discord_game_sdk.so /usr/lib/libdiscord_game_sdk.so && | |
sudo mv discord_game_sdk/cpp /usr/src/discord-game-sdk && | |
sudo mv discord_game_sdk/c /usr/include/discord-game-sdk | |
- name: Create Build Folder | |
run: | | |
mkdir "${{needs.config.outputs.tf2bd_build_dir}}" | |
- name: Configure Build | |
working-directory: ${{needs.config.outputs.tf2bd_build_dir}} | |
run: | | |
cmake -G Ninja \ | |
-DTF2BD_IS_CI_COMPILE=ON \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \ | |
-DTF2BD_ENABLE_DISCORD_INTEGRATION=${{ matrix.discord_integration }} \ | |
-DTF2BD_VERSION_BUILD=${{ github.run_number }} \ | |
-DDISCORD_GAME_SDK_INCLUDE=/usr/src \ | |
../ | |
- name: Build tf2bd | |
working-directory: ${{needs.config.outputs.tf2bd_build_dir}} | |
run: | | |
cmake --build . --config ${{matrix.build_type}} | |
- name: "Artifacts: Prepare staging/" | |
if: steps.determine_artifact_behavior.outputs.upload | |
run: | | |
echo "Copying build artifacts to staging..." | |
cp -v ${{ needs.config.outputs.tf2bd_build_dir }}/tf2_bot_detector/tf2_bot_detector ${{ needs.config.outputs.tf2bd_workspace }}/staging/ | |
cp -v ${{ needs.config.outputs.tf2bd_build_dir }}/submodules/mh_stuff/libmh-stuff.so ${{ needs.config.outputs.tf2bd_workspace }}/staging/ | |
- name: "Artifacts: Upload staging/" | |
if: steps.determine_artifact_behavior.outputs.upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: "tf2-bot-detector_${{ matrix.os }}_${{ matrix.triplet }}_${{ needs.config.outputs.tf2bd_version }}_${{ matrix.build_type }}" | |
if-no-files-found: error | |
path: ${{ needs.config.outputs.tf2bd_workspace }}/staging/ |