diff --git a/.github/workflows/mapbase_build-base.yml b/.github/workflows/mapbase_build-base.yml index d7892f49721..4c3196300e9 100644 --- a/.github/workflows/mapbase_build-base.yml +++ b/.github/workflows/mapbase_build-base.yml @@ -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: | @@ -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 # -------------------------------------------------------------------- @@ -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: | @@ -101,17 +101,19 @@ 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: | @@ -119,12 +121,11 @@ jobs: 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 @@ -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: | @@ -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 diff --git a/.github/workflows/mapbase_build-games-x86.yml b/.github/workflows/mapbase_build-games-x86.yml deleted file mode 100644 index 2a66fd46e0e..00000000000 --- a/.github/workflows/mapbase_build-games-x86.yml +++ /dev/null @@ -1,44 +0,0 @@ -# -# MAPBASE SOURCE 2013 CI -# -# Builds game projects every time a pull request which modifies the game 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 Game [SP] - -on: - pull_request: - branches: - - develop - - mapbase-mp-2025 - paths: - - '.github/workflows/mapbase_build-base.yml' - - '.github/workflows/mapbase_build-games.yml' - - 'src/vpc_scripts/**' - - 'src/game/**' - - '!src/game/server/tf/**' - - '!src/game/client/tf/**' - - '!src/game/shared/tf/**' - - '!src/game/server/hl2mp/**' - - '!src/game/client/hl2mp/**' - - '!src/game/shared/hl2mp/**' - - 'src/mathlib/**' - - 'src/responserules/runtime/**' - - 'src/tier1/**' - - 'src/vgui2/vgui_controls/**' - - 'src/vscript/**' - -jobs: - games: - strategy: - matrix: - configuration: [Release, Debug] - uses: ./.github/workflows/mapbase_build-base.yml - with: - configuration: ${{ matrix.configuration }} - game: 'hl2 /episodic' # Change this if your mod is not using these game projects - project-group: 'game' - build-linux: true # Disable this if you don't want to compile for Linux - arch: '32' diff --git a/.github/workflows/mapbase_build-games.yml b/.github/workflows/mapbase_build-games.yml deleted file mode 100644 index cdc880a5e84..00000000000 --- a/.github/workflows/mapbase_build-games.yml +++ /dev/null @@ -1,44 +0,0 @@ -# -# MAPBASE SOURCE 2013 CI -# -# Builds game projects every time a pull request which modifies the game 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 Game [MP] - -on: - pull_request: - branches: - - develop - - mapbase-mp-2025 - paths: - - '.github/workflows/mapbase_build-base.yml' - - '.github/workflows/mapbase_build-games.yml' - - 'src/vpc_scripts/**' - - 'src/game/**' - - '!src/game/server/hl2/**' - - '!src/game/client/hl2/**' - - '!src/game/shared/hl2/**' - - '!src/game/server/episodic/**' - - '!src/game/client/episodic/**' - - '!src/game/shared/episodic/**' - - 'src/mathlib/**' - - 'src/responserules/runtime/**' - - 'src/tier1/**' - - 'src/vgui2/vgui_controls/**' - - 'src/vscript/**' - -jobs: - games: - strategy: - matrix: - configuration: [Release, Debug] - uses: ./.github/workflows/mapbase_build-base.yml - with: - configuration: ${{ matrix.configuration }} - game: 'tf /hl2mp' # Change this if your mod is not using these game projects - project-group: 'game' - build-linux: true # Disable this if you don't want to compile for Linux - arch: '64' diff --git a/.github/workflows/mapbase_build-generic.yml b/.github/workflows/mapbase_build-generic.yml new file mode 100644 index 00000000000..1868cd1dda0 --- /dev/null +++ b/.github/workflows/mapbase_build-generic.yml @@ -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 }} diff --git a/.github/workflows/mapbase_build-maptools.yml b/.github/workflows/mapbase_build-maptools.yml deleted file mode 100644 index 7cf3da92697..00000000000 --- a/.github/workflows/mapbase_build-maptools.yml +++ /dev/null @@ -1,39 +0,0 @@ -# -# MAPBASE SOURCE 2013 CI -# -# Builds map tool projects every time a pull request which modifies the map tool 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 Map Tools - -on: - pull_request: - branches: - - develop - - mapbase-mp-2025 - paths: - - '.github/workflows/mapbase_build-maptools.yml' - - 'src/vpc_scripts/**' - - 'src/utils/vbsp/**' - - 'src/utils/vvis/**' - - 'src/utils/vvis_launcher/**' - - 'src/utils/vrad/**' - - 'src/utils/vrad_launcher/**' - - 'src/mathlib/**' - - 'src/tier1/**' - - 'src/vgui2/vgui_controls/**' - - 'src/vscript/**' - -jobs: - maptools: - strategy: - matrix: - configuration: [Release, Debug] - arch: [32, 64] - uses: ./.github/workflows/mapbase_build-base.yml - with: - configuration: ${{ matrix.configuration }} - project-group: 'maptools' - arch: ${{ matrix.arch }} diff --git a/.github/workflows/mapbase_build-shaders.yml b/.github/workflows/mapbase_build-shaders.yml deleted file mode 100644 index a023369dd43..00000000000 --- a/.github/workflows/mapbase_build-shaders.yml +++ /dev/null @@ -1,39 +0,0 @@ -# -# MAPBASE SOURCE 2013 CI -# -# Builds shader projects every time a pull request which modifies the shader 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 Shaders - -on: - pull_request: - branches: - - develop - - mapbase-mp-2025 - paths: - - '.github/workflows/mapbase_build-shaders.yml' - - 'src/vpc_scripts/**' - - 'src/materialsystem/**' - - 'src/mathlib/**' - -jobs: - shaders: - strategy: - matrix: - configuration: [Release, Debug] - arch: [32, 64] - include: - - game: 'episodic' # Should be switched to 'tf /hl2mp' once we figure out what's wrong with the MP projects - arch: 64 - - game: 'episodic' - arch: 32 - uses: ./.github/workflows/mapbase_build-base.yml - with: - configuration: ${{ matrix.configuration }} - game: ${{ matrix.game }} - project-group: 'shaders' - build-linux: true # Disable this if you don't want to compile for Linux - arch: ${{ matrix.arch }} diff --git a/src/materialsystem/stdshaders/stdshader_dx9_inc.vpc b/src/materialsystem/stdshaders/stdshader_dx9_inc.vpc index f80b39347e2..d645d90f59d 100644 --- a/src/materialsystem/stdshaders/stdshader_dx9_inc.vpc +++ b/src/materialsystem/stdshaders/stdshader_dx9_inc.vpc @@ -16,8 +16,10 @@ $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] } } @@ -25,8 +27,8 @@ $Configuration "Release" { $General { - $OutputDirectory "Release_dx9" [$WINDOWS] - $IntermediateDirectory "Release_dx9" [$WINDOWS] + $OutputDirectory "Release_dx9" [$WINDOWS&&!$MAPBASE] + $IntermediateDirectory "Release_dx9" [$WINDOWS&&!$MAPBASE] } } diff --git a/src/vpc_scripts/projects.vgc b/src/vpc_scripts/projects.vgc index 0b172bfe735..a360c2a91ea 100644 --- a/src/vpc_scripts/projects.vgc +++ b/src/vpc_scripts/projects.vgc @@ -92,7 +92,7 @@ $Project "motionmapper" $Project "phonemeextractor" { - "utils\phonemeextractor\phonemeextractor.vpc" [$WIN32] + "utils\phonemeextractor\phonemeextractor.vpc" [$WIN32&&!$CI_RUNNER] } $Project "raytrace"