From e2afd4a745f8d6b480caff630b59c7379cc627c6 Mon Sep 17 00:00:00 2001 From: SGKoishi Date: Sat, 23 May 2020 20:27:56 -0700 Subject: [PATCH 1/7] Update workflow --- .github/workflows/build.yml | 92 ++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67a3ae87..b4f9a045 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,67 +6,83 @@ jobs: build: runs-on: windows-latest 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: 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 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TerrariaServerAPI\TShock.4.OTAPI.sln /p:Configuration=Debug + 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: OTAPI Release - 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 - TShock.Modifications.Bootstrapper.exe - - name: TerrariaServerAPI Debug + - name: Build TerrariaServerAPI (Debug) 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 + MSBuild.exe .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Debug + - name: Build TShock (Debug) 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 + MSBuild.exe .\TShockAPI\TShockAPI.csproj /p:Configuration=Debug + - name: Prepare packaging 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 - - 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 + - name: Upload TShock (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) + 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: 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 From f999e3dbe922b7567569b87664d1901db65d8097 Mon Sep 17 00:00:00 2001 From: SGKoishi Date: Sat, 23 May 2020 23:35:22 -0700 Subject: [PATCH 2/7] Use 'not debug' instead of release to avoid ambiguity --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4f9a045..52245365 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,19 +53,19 @@ jobs: with: name: Experimental (debug) OTAPI Bootstrapper path: .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Debug\TShock.Modifications.Bootstrapper.exe - - name: Build OTAPI (Release) + - name: Build OTAPI (Not Debug) 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) + - name: Build TerrariaServerAPI (Not Debug) shell: cmd run: | cd .\TerrariaServerAPI MSBuild.exe .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Release - - name: Build TShock (Release) + - name: Build TShock (Not Debug) shell: cmd run: | nuget restore TShock.sln @@ -76,12 +76,12 @@ jobs: 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) + - name: Upload TShock (Not Debug) uses: actions/upload-artifact@master with: name: Experimental TShock (not debug) path: TShockAPI\bin\Release - - name: Upload OTAPI Bootstrapper (Release) + - name: Upload OTAPI Bootstrapper (Not Debug) uses: actions/upload-artifact@master with: name: Experimental (not debug) OTAPI Bootstrapper From 7e5490a9993899b452c86cbf5bce1988adab8bb0 Mon Sep 17 00:00:00 2001 From: SGKoishi Date: Sun, 24 May 2020 00:41:06 -0700 Subject: [PATCH 3/7] Update 'release' wording --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52245365..ef4cd3b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: run: | nuget restore TShock.sln MSBuild.exe .\TShockAPI\TShockAPI.csproj /p:Configuration=Release - - name: Prepare packaging + - name: Normalize release packaging shell: cmd run: | xcopy /Y prebuilts\*.* TShockAPI\bin\Release From 50b246c4a34b9c3f6563a4072eeb3a5d5e55c963 Mon Sep 17 00:00:00 2001 From: SGKoishi Date: Sun, 24 May 2020 14:05:57 -0700 Subject: [PATCH 4/7] Revert MSBuild PATH variable --- .github/workflows/build.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef4cd3b0..a796464b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,11 +10,6 @@ jobs: 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 @@ -24,19 +19,19 @@ jobs: - name: Build OTAPI (Debug) shell: cmd run: | - MSBuild.exe .\TerrariaServerAPI\TShock.4.OTAPI.sln /p:Configuration=Debug + "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: Build TerrariaServerAPI (Debug) shell: cmd run: | cd .\TerrariaServerAPI - MSBuild.exe .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Debug + "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\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 + "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TShockAPI\TShockAPI.csproj /p:Configuration=Debug - name: Prepare packaging shell: cmd run: | @@ -57,19 +52,19 @@ jobs: shell: cmd run: | nuget restore .\TerrariaServerAPI\TShock.4.OTAPI.sln - MSBuild.exe .\TerrariaServerAPI\TShock.4.OTAPI.sln /p:Configuration=Release + "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 TShock.Modifications.Bootstrapper.exe - name: Build TerrariaServerAPI (Not Debug) shell: cmd run: | cd .\TerrariaServerAPI - MSBuild.exe .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Release + "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Release - name: Build TShock (Not Debug) shell: cmd run: | nuget restore TShock.sln - 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=Release - name: Normalize release packaging shell: cmd run: | From 0932cc821a2c6c3faf26818ff6176a64970e0f59 Mon Sep 17 00:00:00 2001 From: SGKoishi Date: Sat, 30 May 2020 14:10:24 -0700 Subject: [PATCH 5/7] Split workflow into Debug and Release --- .github/workflows/build.yml | 49 +++++++++++-------------------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a796464b..38d5ba73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,9 @@ on: [push, pull_request] jobs: build: runs-on: windows-latest + strategy: + matrix: + mode: ["Debug", "Release"] steps: - name: Git checkout uses: actions/checkout@v1 @@ -16,28 +19,27 @@ jobs: run: | nuget restore .\TerrariaServerAPI\TShock.4.OTAPI.sln nuget restore TShock.sln - - name: Build OTAPI (Debug) + - 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=Debug - cd .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Debug + "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 (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: Build 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: Prepare packaging + "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\Debug - mkdir TShockAPI\bin\Debug\ServerPlugins - move TShockAPI\bin\Debug\TShockAPI.dll TShockAPI\bin\Debug\ServerPlugins + 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) uses: actions/upload-artifact@master with: @@ -48,29 +50,6 @@ jobs: with: name: Experimental (debug) OTAPI Bootstrapper path: .\TerrariaServerAPI\TShock.Modifications.Bootstrapper\bin\Debug\TShock.Modifications.Bootstrapper.exe - - name: Build OTAPI (Not Debug) - 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 - TShock.Modifications.Bootstrapper.exe - - name: Build TerrariaServerAPI (Not Debug) - 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: Build TShock (Not Debug) - 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 - - name: Normalize release 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 (Not Debug) uses: actions/upload-artifact@master with: From a815b7556d07f97597fe72c0b9e3ed255effeb78 Mon Sep 17 00:00:00 2001 From: SGKoishi Date: Sat, 30 May 2020 14:58:46 -0700 Subject: [PATCH 6/7] Upload artifacts with condition --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38d5ba73..54c3555f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,21 +41,25 @@ jobs: 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 From 770d17c236cd8691014680fc81f4db590f035524 Mon Sep 17 00:00:00 2001 From: Stargazing Koishi Date: Sat, 30 May 2020 16:07:12 -0700 Subject: [PATCH 7/7] Update .github/workflows/build.yml Co-authored-by: Lucas Nicodemus --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54c3555f..8173267b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v1 with: submodules: recursive - - name: Installer NuGet client + - name: Install NuGet client uses: nuget/setup-nuget@v1 - name: Restore NuGet packages run: |