Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/mapbase_build-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.13'

- name: Add MSBuild to PATH
uses: compnerd/gha-setup-vsdevenv@v6
uses: compnerd/gha-setup-vsdevenv@v7

# HACKHACK: MSBuild doesn't seem to recognize Python even when its directory is within PATH,
# so we currently have to make it call Python directly.
# This assumes %Python3_ROOT_DIR% will always be set by setup-python above.
- name: Implement Python workaround
if: inputs.project-group == 'game' || inputs.project-group == 'everything'
if: contains(inputs.project-group, 'game') || contains(inputs.project-group, 'everything')
working-directory: 'src/game/server'
shell: bash
run: |
Expand All @@ -76,7 +76,7 @@ jobs:
working-directory: 'src'
shell: cmd
run: |
devtools\bin\vpc.exe /${{inputs.game}} /win${{inputs.arch}} /define:SOURCESDK +${{inputs.project-group}} /mksln build.sln
devtools\bin\vpc.exe /${{inputs.game}} /win${{inputs.arch}} /define:SOURCESDK /define:CI_RUNNER +${{inputs.project-group}} /mksln build.sln

# --------------------------------------------------------------------

Expand All @@ -91,7 +91,7 @@ jobs:
# --------------------------------------------------------------------

- name: Publish binaries
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: '${{inputs.project-group}}_win${{inputs.arch}}_${{ inputs.configuration }}'
path: |
Expand All @@ -101,30 +101,31 @@ jobs:
game/mod_*/x64/bin
!game/bin/x64/steam_api64.dll
!game/bin/linux64/libsteam_api.so
game/*.exe
game/*.exe
if-no-files-found: error

build_ubuntu:
if: inputs.build-linux == true && inputs.project-group != 'maptools' # No Linux map tools for now
if: inputs.build-linux == true
name: Linux
runs-on: ubuntu-latest
env:
config: ${{ inputs.configuration }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install podman python3

- name: Pick game
if: inputs.project-group == 'game' || inputs.project-group == 'shaders'
working-directory: 'src'
shell: bash
run: |
sed -i 's|/hl2mp /tf|/${{inputs.game}}|' buildgameprojects
sed -i 's|+game|+${{inputs.project-group}}|' buildgameprojects
sed -i 's|+game|/define:CI_RUNNER +${{inputs.project-group}}|' buildgameprojects
sed -i 's|/linux64|/linux${{inputs.arch}}|' buildgameprojects

- name: Set configuration
Expand Down Expand Up @@ -155,7 +156,7 @@ jobs:
# For now, don't publish the .dbg files even though we publish .pdb files on Windows
# (they're too big)
- name: Publish binaries
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: '${{inputs.project-group}}_linux${{inputs.arch}}_${{ inputs.configuration }}'
path: |
Expand All @@ -168,4 +169,6 @@ jobs:
!game/mod_*/bin/linux64/*_srv.so
!game/mod_*/bin/*_srv.so
!game/bin/linux64/libsteam_api.so
game/*
game/*
if-no-files-found: error
44 changes: 0 additions & 44 deletions .github/workflows/mapbase_build-games-x86.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/mapbase_build-games.yml

This file was deleted.

96 changes: 96 additions & 0 deletions .github/workflows/mapbase_build-generic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#
# MAPBASE SOURCE 2013 CI
#
# Builds projects every time a pull request which modifies the code is opened.
# If you're using a fork of Mapbase, feel free to configure this to meet your repository's needs.
#
# See mapbase_build-base.yml for more information on how this works.

name: Build Projects

on:
pull_request:
branches:
- develop
- mapbase-mp-2025
- feature/combined-sp-mp
paths:
- '.github/workflows/mapbase_build-generic.yml'
- 'src/**'

jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
project-groups: ${{ steps.combine-group.outputs.groups }}
steps:
- uses: actions/checkout@v7

- name: Identify file changes
uses: dorny/paths-filter@v4
id: filter
with:
filters: |
games:
- 'src/game/**'
- 'src/responserules/runtime/**'
- 'src/vgui2/vgui_controls/**'
- 'src/vscript/**'
shaders:
- 'src/materialsystem/**'
maptools:
- 'src/utils/vbsp/**'
- 'src/utils/vvis/**'
- 'src/utils/vvis_launcher/**'
- 'src/utils/vrad/**'
- 'src/utils/vrad_launcher/**'
- 'src/vscript/**'
everything:
- 'src/vpc_scripts/**'
- 'src/mathlib/**'
- 'src/tier1/**'
- '.github/workflows/mapbase_build-generic.yml'

- name: Combine project groups
id: combine-group
env:
in_games_group: ${{ steps.filter.outputs.games }}
in_shaders_group: ${{ steps.filter.outputs.shaders }}
in_maptools_group: ${{ steps.filter.outputs.maptools }}
in_everything_group: ${{ steps.filter.outputs.everything }}
run: |
all_groups=""
if [ "$in_everything_group" = "true" ]; then
# 'everything' encompasses all other groups
all_groups+=" +everything"
else
if [ "$in_games_group" = "true" ]; then
all_groups+=" +game"
fi
if [ "$in_shaders_group" = "true" ]; then
all_groups+=" +shaders"
fi
if [ "$in_maptools_group" = "true" ]; then
all_groups+=" +maptools"
fi
fi
echo "groups=${all_groups:2}" >> "$GITHUB_OUTPUT"

build:
needs: check-changes
strategy:
matrix:
arch: [32, 64]
configuration: [Release, Debug]
include:
- game: 'tf /hl2mp'
arch: 64
- game: 'hl2 /episodic'
arch: 32
uses: ./.github/workflows/mapbase_build-base.yml
with:
configuration: ${{ matrix.configuration }}
game: ${{ matrix.game }}
project-group: ${{ needs.check-changes.outputs.project-groups }}
build-linux: true # Disable this if you don't want to compile for Linux
arch: ${{ matrix.arch }}
39 changes: 0 additions & 39 deletions .github/workflows/mapbase_build-maptools.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/mapbase_build-shaders.yml

This file was deleted.

10 changes: 6 additions & 4 deletions src/materialsystem/stdshaders/stdshader_dx9_inc.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ $Configuration "Debug"
{
$General
{
$OutputDirectory "Debug_dx9" [$WINDOWS]
$IntermediateDirectory "Debug_dx9" [$WINDOWS]
// Causes problems when building multiple shader projects in parallel.
// It'd be nice to automate dependency, but for now, just fall back to game-based naming
$OutputDirectory "Debug_dx9" [$WINDOWS&&!$MAPBASE]
$IntermediateDirectory "Debug_dx9" [$WINDOWS&&!$MAPBASE]
}
}

$Configuration "Release"
{
$General
{
$OutputDirectory "Release_dx9" [$WINDOWS]
$IntermediateDirectory "Release_dx9" [$WINDOWS]
$OutputDirectory "Release_dx9" [$WINDOWS&&!$MAPBASE]
$IntermediateDirectory "Release_dx9" [$WINDOWS&&!$MAPBASE]
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/vpc_scripts/projects.vgc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ $Project "motionmapper"

$Project "phonemeextractor"
{
"utils\phonemeextractor\phonemeextractor.vpc" [$WIN32]
"utils\phonemeextractor\phonemeextractor.vpc" [$WIN32&&!$CI_RUNNER]
}

$Project "raytrace"
Expand Down
Loading