Skip to content

Rename protobufs to game_protobufs third-party directory #286

Rename protobufs to game_protobufs third-party directory

Rename protobufs to game_protobufs third-party directory #286

Workflow file for this run

name: Build on Windows
on:
push:
branches: [ "main" ]
paths:
- '.github/workflows/build-windows.yml'
- 'cmake/**'
- 'common/**'
- 'devtools/bin/win64/**'
- 'entity2/**'
- 'game/server/**'
- 'game/shared/**'
- 'gcsdk/**'
- 'interfaces/**'
- 'lib/win64/**'
- 'mathlib/**'
- 'public/**'
- 'thirdparty/**'
- 'tier1/**'
- 'CMakeGameManifests.json'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'trigger-build.txt'
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/build-windows.yml'
- 'cmake/**'
- 'common/**'
- 'devtools/bin/win64/**'
- 'entity2/**'
- 'game/server/**'
- 'game/shared/**'
- 'interfaces/**'
- 'lib/win64/**'
- 'mathlib/**'
- 'public/**'
- 'thirdparty/**'
- 'tier1/**'
- 'CMakeGameManifests.json'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'trigger-build.txt'
env:
CMAKE_CONFIGURE_PRESET_NAME: VisualStudio
CMAKE_DEBUG_BUILD_PRESET_NAME: VisualStudio\Debug
CMAKE_DEBUG_BUILD_PRESET_PUBLIC_NAME: VisualStudio-Debug
CMAKE_DEBUG_OUTPUT_PATTERN: build\Windows\VisualStudio\Debug\*
CMAKE_RELEASE_BUILD_PRESET_NAME: VisualStudio\Release
CMAKE_RELEASE_BUILD_PRESET_PUBLIC_NAME: VisualStudio-Release
CMAKE_RELEASE_OUTPUT_PATTERN: build\Windows\VisualStudio\Release\*
COMPILER_CC: cl
COMPILER_CXX: cl
COMPILER_NAME: MSVC
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- name: Set up environment variables
run: |
echo "REPOSITORY_NAME=$(basename ${env:GITHUB_REPOSITORY})" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "ABSOLUTE_PATH=${env:GITHUB_WORKSPACE}" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh
- name: Configure Git to treat current directory as safe
run: git config --global --add safe.directory $env:GITHUB_WORKSPACE
shell: pwsh
- name: Get latest tag
id: get-latest-tag
run: |
if ((git tag) -eq $null) {
echo "No tags found"
echo "LATEST_TAG=none" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
$LATEST_TAG = git describe --tags (git rev-list --tags --max-count=1)
echo "LATEST_TAG=$LATEST_TAG" | Out-File -FilePath $env:GITHUB_ENV -Append
}
shell: pwsh
- name: Configure CMake
run: >
cmake --preset ${{ env.CMAKE_CONFIGURE_PRESET_NAME }}
-DCMAKE_C_COMPILER=${{ env.COMPILER_CC }}
-DCMAKE_CXX_COMPILER=${{ env.COMPILER_CXX }}
- name: Debug - Build
run: cmake --build --preset ${{ env.CMAKE_DEBUG_BUILD_PRESET_NAME }} --parallel
- name: Debug - Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.REPOSITORY_NAME }}-${{ env.LATEST_TAG }}-${{ runner.os }}-${{ env.COMPILER_NAME }}-${{ env.CMAKE_DEBUG_BUILD_PRESET_PUBLIC_NAME }}
path: ${{ env.CMAKE_DEBUG_OUTPUT_PATTERN }}
- name: Release - Build
run: cmake --build --preset ${{ env.CMAKE_RELEASE_BUILD_PRESET_NAME }} --parallel
- name: Release - Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.REPOSITORY_NAME }}-${{ env.LATEST_TAG }}-${{ runner.os }}-${{ env.COMPILER_NAME }}-${{ env.CMAKE_RELEASE_BUILD_PRESET_PUBLIC_NAME }}
path: ${{ env.CMAKE_RELEASE_OUTPUT_PATTERN }}