Merge pull request #1880 from sgkoishi/general-devel

Optimize workflow
This commit is contained in:
Lucas Nicodemus 2020-05-30 16:21:20 -07:00 committed by GitHub
commit 3f0e51080b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,68 +5,62 @@ on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
mode: ["Debug", "Release"]
steps:
- uses: actions/checkout@v1
- name: Git checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Install nuget
run: choco install nuget.commandline
- name: OTAPI Debug
shell: cmd
- name: Install NuGet client
uses: nuget/setup-nuget@v1
- name: Restore NuGet packages
run: |
nuget restore .\TerrariaServerAPI\TShock.4.OTAPI.sln
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TerrariaServerAPI\TShock.4.OTAPI.sln /p:Configuration=Debug
cd .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Debug
TShock.Modifications.Bootstrapper.exe
- name: OTAPI Release
nuget restore TShock.sln
- name: Build OTAPI
shell: cmd
run: |
nuget restore .\TerrariaServerAPI\TShock.4.OTAPI.sln
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TerrariaServerAPI\TShock.4.OTAPI.sln /p:Configuration=Release
cd .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Release
"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: TerrariaServerAPI Debug
- 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=Debug
- name: TShock Debug
"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: |
nuget restore TShock.sln
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TShockAPI\TShockAPI.csproj /p:Configuration=Debug
- name: TerrariaServerAPI Release
shell: cmd
run: |
cd .\TerrariaServerAPI
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Release
- name: TShock Release
shell: cmd
run: |
nuget restore TShock.sln
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TShockAPI\TShockAPI.csproj /p:Configuration=Release
"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\Release
xcopy /Y prebuilts\*.* TShockAPI\bin\Debug
mkdir TShockAPI\bin\Debug\ServerPlugins
mkdir TShockAPI\bin\Release\ServerPlugins
move TShockAPI\bin\Release\TShockAPI.dll TShockAPI\bin\Release\ServerPlugins
move TShockAPI\bin\Debug\TShockAPI.dll TShockAPI\bin\Debug\ServerPlugins
- uses: actions/upload-artifact@master
with:
name: Experimental TShock (not debug)
path: TShockAPI\bin\Release
- uses: actions/upload-artifact@master
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
- uses: actions/upload-artifact@master
- 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
- uses: actions/upload-artifact@master
- 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