Skip to content

Commit

Permalink
Merge pull request #1 from Planimeter/feature/msbuild
Browse files Browse the repository at this point in the history
Feature/msbuild
  • Loading branch information
andrewmcwatters authored Dec 14, 2024
2 parents 0d8dcee + a74a6a3 commit a895557
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 2 deletions.
Binary file added .github/workflows/DefaultProjectExtension.reg
Binary file not shown.
54 changes: 54 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: MSBuild

on:
push:
branches: [ "master", "feature/msbuild" ]
pull_request:
branches: [ "master" ]

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./mp/src/games.sln

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

permissions:
contents: read

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

# - name: Restore NuGet packages
# working-directory: ${{env.GITHUB_WORKSPACE}}
# run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- run: REG IMPORT .github/workflows/DefaultProjectExtension.reg

- working-directory: ./mp/src
shell: cmd
run: creategameprojects.bat

- working-directory: ./mp/src
shell: bash
run: ./devtools/fixsln.sh games.sln

- name: Build
working-directory: ${{github.workspace}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
2 changes: 1 addition & 1 deletion mp/src/createallprojects.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
devtools\bin\vpc.exe /hl2mp +everything /mksln everything.sln
devtools\bin\vpc.exe /hl2mp +everything /mksln everything.sln /define:VS2022
2 changes: 1 addition & 1 deletion mp/src/creategameprojects.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
devtools\bin\vpc.exe /hl2mp +game /mksln games.sln
devtools\bin\vpc.exe /hl2mp +game /mksln games.sln /define:VS2022
41 changes: 41 additions & 0 deletions mp/src/devtools/fixsln.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

Global=$(cat << 'EOF'
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{17BCE59A-9037-EC8D-433E-F81339E2F1BA}.Debug|Win32.ActiveCfg = Debug|Win32
{17BCE59A-9037-EC8D-433E-F81339E2F1BA}.Debug|Win32.Build.0 = Debug|Win32
{17BCE59A-9037-EC8D-433E-F81339E2F1BA}.Release|Win32.ActiveCfg = Release|Win32
{17BCE59A-9037-EC8D-433E-F81339E2F1BA}.Release|Win32.Build.0 = Release|Win32
{BAB92FF0-D72A-D7E5-1988-74628D39B94F}.Debug|Win32.ActiveCfg = Debug|Win32
{BAB92FF0-D72A-D7E5-1988-74628D39B94F}.Debug|Win32.Build.0 = Debug|Win32
{BAB92FF0-D72A-D7E5-1988-74628D39B94F}.Release|Win32.ActiveCfg = Release|Win32
{BAB92FF0-D72A-D7E5-1988-74628D39B94F}.Release|Win32.Build.0 = Release|Win32
{95D67225-8415-236F-9128-DCB171B7DEC6}.Debug|Win32.ActiveCfg = Debug|Win32
{95D67225-8415-236F-9128-DCB171B7DEC6}.Debug|Win32.Build.0 = Debug|Win32
{95D67225-8415-236F-9128-DCB171B7DEC6}.Release|Win32.ActiveCfg = Release|Win32
{95D67225-8415-236F-9128-DCB171B7DEC6}.Release|Win32.Build.0 = Release|Win32
{33B7DFDC-BECB-3678-1190-6C951E393EB3}.Debug|Win32.ActiveCfg = Debug|Win32
{33B7DFDC-BECB-3678-1190-6C951E393EB3}.Debug|Win32.Build.0 = Debug|Win32
{33B7DFDC-BECB-3678-1190-6C951E393EB3}.Release|Win32.ActiveCfg = Release|Win32
{33B7DFDC-BECB-3678-1190-6C951E393EB3}.Release|Win32.Build.0 = Release|Win32
{EC1C516D-E1D9-BC0A-F79D-E91E954ED8EC}.Debug|Win32.ActiveCfg = Debug|Win32
{EC1C516D-E1D9-BC0A-F79D-E91E954ED8EC}.Debug|Win32.Build.0 = Debug|Win32
{EC1C516D-E1D9-BC0A-F79D-E91E954ED8EC}.Release|Win32.ActiveCfg = Release|Win32
{EC1C516D-E1D9-BC0A-F79D-E91E954ED8EC}.Release|Win32.Build.0 = Release|Win32
{F69B3672-C5E8-CD1A-257F-253A25B5B939}.Debug|Win32.ActiveCfg = Debug|Win32
{F69B3672-C5E8-CD1A-257F-253A25B5B939}.Debug|Win32.Build.0 = Debug|Win32
{F69B3672-C5E8-CD1A-257F-253A25B5B939}.Release|Win32.ActiveCfg = Release|Win32
{F69B3672-C5E8-CD1A-257F-253A25B5B939}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
EOF
)
echo "$Global" >> "$1"
1 change: 1 addition & 0 deletions mp/src/vpc_scripts/source_win32_base.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $Configuration
$PlatformToolset "v110" [$VS2012 && $ANALYZE] // VS 2012 for /analyze
$PlatformToolset "v120_xp" [$VS2013 && !$ANALYZE] // VS 2013 targeting Windows XP - http://msdn.microsoft.com/en-us/library/vstudio/jj851139.aspx
$PlatformToolset "v120" [$VS2013 && $ANALYZE] // VS 2013 for /analyze
$PlatformToolset "v143" [$VS2022]
}

$General
Expand Down

0 comments on commit a895557

Please sign in to comment.