TShock/.github/workflows/build.yml
2020-05-23 20:42:41 -07:00

88 lines
3.4 KiB
YAML

name: Build Server
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- name: Git checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Add MSBuild to environment variable
shell: pwsh
run: |
$msbuildPath = Split-Path (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\Current\Bin\amd64\MSBuild.exe | Select-Object -First 1) -Parent
echo "::set-env name=PATH::$msbuildPath;$env:PATH"
- name: Installer 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 (Debug)
shell: cmd
run: |
MSBuild.exe .\TerrariaServerAPI\TShock.4.OTAPI.sln /p:Configuration=Debug
cd .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Debug
TShock.Modifications.Bootstrapper.exe
- name: Build TerrariaServerAPI (Debug)
shell: cmd
run: |
cd .\TerrariaServerAPI
MSBuild.exe .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Debug
- name: Build TShock (Debug)
shell: cmd
run: |
nuget restore TShock.sln
MSBuild.exe .\TShockAPI\TShockAPI.csproj /p:Configuration=Debug
- name: Prepare packaging
shell: cmd
run: |
xcopy /Y prebuilts\*.* TShockAPI\bin\Debug
mkdir TShockAPI\bin\Debug\ServerPlugins
move TShockAPI\bin\Debug\TShockAPI.dll TShockAPI\bin\Debug\ServerPlugins
- name: Upload TShock (Debug)
uses: actions/upload-artifact@master
with:
name: Experimental TShock (debug)
path: TShockAPI\bin\Debug
- name: Upload OTAPI Bootstrapper (Debug)
uses: actions/upload-artifact@master
with:
name: Experimental (debug) OTAPI Bootstrapper
path: .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Debug\TShock.Modifications.Bootstrapper.exe
- name: Build OTAPI (Release)
shell: cmd
run: |
nuget restore .\TerrariaServerAPI\TShock.4.OTAPI.sln
MSBuild.exe .\TerrariaServerAPI\TShock.4.OTAPI.sln /p:Configuration=Release
cd .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Release
TShock.Modifications.Bootstrapper.exe
- name: Build TerrariaServerAPI (Release)
shell: cmd
run: |
cd .\TerrariaServerAPI
MSBuild.exe .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Release
- name: Build TShock (Release)
shell: cmd
run: |
nuget restore TShock.sln
MSBuild.exe .\TShockAPI\TShockAPI.csproj /p:Configuration=Release
- name: Prepare packaging
shell: cmd
run: |
xcopy /Y prebuilts\*.* TShockAPI\bin\Release
mkdir TShockAPI\bin\Release\ServerPlugins
move TShockAPI\bin\Release\TShockAPI.dll TShockAPI\bin\Release\ServerPlugins
- name: Upload TShock (Release)
uses: actions/upload-artifact@master
with:
name: Experimental TShock (not debug)
path: TShockAPI\bin\Release
- name: Upload OTAPI Bootstrapper (Release)
uses: actions/upload-artifact@master
with:
name: Experimental (not debug) OTAPI Bootstrapper
path: .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Release\TShock.Modifications.Bootstrapper.exe