TShock/.github/workflows/build.yml
Lucas Nicodemus 21d2c0ad10 Switch GitHub Actions runner to use windows-2019
GitHub is apparently in a 4-week migration to switch to Windows Server
2022 instead of Windows Server 2019 for `windows-latest` tags, and we've
     been caught in the middle of the transition with a Terraria update.
Rather than trying to update our build scripts to run on 2022, this
temporarily downgrades us to Windows Server 2019 so we can actually
update Terraria and not windows.
2022-02-25 01:23:07 -08:00

66 lines
2.6 KiB
YAML

name: Build Server
on: [push, pull_request]
jobs:
build:
runs-on: windows-2019
strategy:
matrix:
mode: ["Debug", "Release"]
steps:
- name: Git checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Install NuGet client
uses: nuget/setup-nuget@v1
- name: Restore NuGet packages
run: |
nuget restore .\TerrariaServerAPI\TShock.4.OTAPI.sln
nuget restore TShock.sln
- name: Build OTAPI
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TerrariaServerAPI\TShock.4.OTAPI.sln /p:Configuration=${{ matrix.mode }}
cd .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\${{ matrix.mode }}
TShock.Modifications.Bootstrapper.exe
- name: Build TerrariaServerAPI
shell: cmd
run: |
cd .\TerrariaServerAPI
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=${{ matrix.mode }}
- name: Build TShock
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TShockAPI\TShockAPI.csproj /p:Configuration=${{ matrix.mode }}
- name: Normalize release packaging
shell: cmd
run: |
xcopy /Y prebuilts\*.* TShockAPI\bin\${{ matrix.mode }}
mkdir TShockAPI\bin\${{ matrix.mode }}\ServerPlugins
move TShockAPI\bin\${{ matrix.mode }}\TShockAPI.dll TShockAPI\bin\${{ matrix.mode }}\ServerPlugins
- name: Upload TShock (Debug)
if: contains(matrix.mode, 'Debug')
uses: actions/upload-artifact@master
with:
name: Experimental TShock (debug)
path: TShockAPI\bin\Debug
- name: Upload OTAPI Bootstrapper (Debug)
if: contains(matrix.mode, 'Debug')
uses: actions/upload-artifact@master
with:
name: Experimental (debug) OTAPI Bootstrapper
path: .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Debug\TShock.Modifications.Bootstrapper.exe
- name: Upload TShock (Not Debug)
if: contains(matrix.mode, 'Release')
uses: actions/upload-artifact@master
with:
name: Experimental TShock (not debug)
path: TShockAPI\bin\Release
- name: Upload OTAPI Bootstrapper (Not Debug)
if: contains(matrix.mode, 'Release')
uses: actions/upload-artifact@master
with:
name: Experimental (not debug) OTAPI Bootstrapper
path: .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Release\TShock.Modifications.Bootstrapper.exe