Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 20 additions & 6 deletions .github/workflows/mapbase_build-base-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ on:
- Debug
game:
description: 'Name of the game to build (if relevant)'
default: 'episodic'
default: 'tf /hl2mp'
required: false
type: choice
options:
- episodic
- episodic /hl2
- hl2
- hl2mp
- hl2mp /episodic
- tf
- tf /hl2mp
project-group:
Expand All @@ -39,8 +38,21 @@ on:
- game
- shaders
- maptools
build-on-linux:
description: 'Build on Ubuntu/Linux?'
arch:
description: 'Which architecture to build for'
default: '64'
required: false
type: choice
options:
- 64
- 32
build-windows:
description: 'Build on Windows?'
default: true
required: false
type: boolean
build-linux:
description: 'Build on Linux?'
default: true
required: false
type: boolean
Expand All @@ -52,4 +64,6 @@ jobs:
configuration: '${{ github.event.inputs.configuration }}'
game: '${{ github.event.inputs.game }}'
project-group: '${{ github.event.inputs.project-group }}'
build-on-linux: "${{ github.event.inputs.build-on-linux == 'true' }}"
arch: '${{ github.event.inputs.arch }}'
build-windows: "${{ github.event.inputs.build-windows == 'true' }}"
build-linux: "${{ github.event.inputs.build-linux == 'true' }}"
51 changes: 33 additions & 18 deletions .github/workflows/mapbase_build-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,42 @@ on:
description: 'Which group of projects to compile'
required: true
type: string
build-on-linux:
description: 'Build on Ubuntu/Linux?'
arch:
description: 'Which architecture to build for'
default: '64'
required: false
type: string
build-windows:
description: 'Build on Windows?'
default: true
required: false
type: boolean
build-linux:
description: 'Build on Linux?'
default: true
required: false
type: boolean

jobs:
build_windows:
name: Windows (VS2022)
if: inputs.build-windows
name: Windows
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 @@ -65,7 +76,7 @@ jobs:
working-directory: 'src'
shell: cmd
run: |
devtools\bin\vpc.exe /${{inputs.game}} /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 @@ -75,45 +86,47 @@ jobs:
shell: cmd
run: |
devenv build.sln /upgrade
msbuild -m -t:Rebuild -p:Configuration=${{inputs.configuration}};Platform=win64 build.sln
msbuild -m -t:Rebuild -p:Configuration=${{inputs.configuration}};Platform=win${{inputs.arch}} build.sln

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

- name: Publish binaries
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: '${{inputs.project-group}}_win64_${{ inputs.configuration }}'
name: '${{inputs.project-group}}_win${{inputs.arch}}_${{ inputs.configuration }}'
path: |
game/bin
game/bin/x64
game/mod_*/bin
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-on-linux == true && inputs.project-group != 'maptools' # No Linux map tools for now
name: Ubuntu (GCC/G++)
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
working-directory: 'src'
Expand Down Expand Up @@ -143,9 +156,9 @@ 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}}_linux64_${{ inputs.configuration }}'
name: '${{inputs.project-group}}_linux${{inputs.arch}}_${{ inputs.configuration }}'
path: |
game/bin/linux64/*.so
game/bin/*.so
Expand All @@ -156,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
37 changes: 0 additions & 37 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 }}
38 changes: 0 additions & 38 deletions .github/workflows/mapbase_build-maptools.yml

This file was deleted.

12 changes: 10 additions & 2 deletions .github/workflows/mapbase_build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# See mapbase_build-base.yml for more information on how this works.

name: Build All Projects #(SP Release)
name: Build All

on:
pull_request:
Expand All @@ -22,8 +22,16 @@ jobs:
strategy:
matrix:
configuration: [Release, Debug]
arch: [32, 64]
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: 'everything'
build-on-linux: true # Disable this if you don't want to compile for Linux
build-linux: true # Disable this if you don't want to compile for Linux
arch: ${{ matrix.arch }}
Loading
Loading