Merge pull request #1681 from sgkoishi/general-devel
Add GitHub Actions build
This commit is contained in:
commit
9901281669
4 changed files with 64 additions and 14 deletions
41
.github/workflows/build.yml
vendored
Normal file
41
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
name: Build Server
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Download MSBuild installer
|
||||
run: powershell "$source = Get-Content -Path \"scripts\\SetupMSBuild.cs\" ; Add-Type
|
||||
-TypeDefinition \"$source\" ; [SetupMSBuild]::Download((Get-Item -Path \".\\\").FullName);
|
||||
"
|
||||
- name: Setup .NET SDK
|
||||
run: start /i /wait vs_BuildTools.exe --add "Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools" -p --wait --installPath "%cd%\VSBuildTools" --norestart --nocache
|
||||
- name: OTAPI Debug
|
||||
run: |
|
||||
nuget.exe restore .\TerrariaServerAPI\TShock.4.OTAPI.sln
|
||||
".\VSBuildTools\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
|
||||
run: |
|
||||
nuget.exe restore .\TerrariaServerAPI\TShock.4.OTAPI.sln
|
||||
".\VSBuildTools\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
|
||||
run: |
|
||||
cd .\TerrariaServerAPI
|
||||
"..\VSBuildTools\MSBuild\Current\Bin\MSBuild.exe" .\TerrariaServerAPI\TerrariaServerAPI.csproj /p:Configuration=Release
|
||||
- name: TShock
|
||||
run: |
|
||||
nuget.exe restore TShock.sln
|
||||
".\VSBuildTools\MSBuild\Current\Bin\MSBuild.exe" .\TShockAPI\TShockAPI.csproj /p:Configuration=Release
|
||||
- uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: TShockRelease
|
||||
path: TShockAPI\bin\Release
|
||||
13
.github/workflows/msbuild-test.yml
vendored
13
.github/workflows/msbuild-test.yml
vendored
|
|
@ -1,13 +0,0 @@
|
|||
name: MSBuild Test
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '4.5.1'
|
||||
- run: dotnet build --configuration Release ./TShockAPI/TShockAPI.csproj
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<p align="center">
|
||||
<img src="https://tshock.co/newlogo.png" alt="TShock for Terraria"><br />
|
||||
<a href="https://travis-ci.org/Pryaxis/TShock"><img src="https://travis-ci.org/Pryaxis/TShock.svg?branch=general-devel" alt="Build Status"></a><a href="https://ci.appveyor.com/project/hakusaro/tshock"><img src="https://ci.appveyor.com/api/projects/status/chhe61q227lqdlg1?svg=true" alt="AppVeyor Build Status"></a><a href="#contributors"><img src="https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square" alt="All contributors"></a><br />
|
||||
<a href="https://travis-ci.org/Pryaxis/TShock"><img src="https://travis-ci.org/Pryaxis/TShock.svg?branch=general-devel" alt="Build Status"></a><a href="https://ci.appveyor.com/project/hakusaro/tshock"><img src="https://ci.appveyor.com/api/projects/status/chhe61q227lqdlg1?svg=true" alt="AppVeyor Build Status"></a><a href="https://github.com/Pryaxis/TShock/actions"><img src="https://github.com/Pryaxis/TShock/workflows/Build%20Server/badge.svg" alt="GitHub Actions Build Status"></a><a href="#contributors"><img src="https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square" alt="All contributors"></a><br />
|
||||
</p>
|
||||
|
||||
TShock is a toolbox for Terraria servers and communities. That toolbox is jam packed with anti-cheat tools, server-side characters, groups, permissions, item bans, tons of commands, and limitless potential. It's one of a kind.
|
||||
|
|
|
|||
22
scripts/SetupMSBuild.cs
Normal file
22
scripts/SetupMSBuild.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
|
||||
public class SetupMSBuild
|
||||
{
|
||||
public static void Download(string directory)
|
||||
{
|
||||
try
|
||||
{
|
||||
var wc = new System.Net.WebClient();
|
||||
var content = wc.DownloadString("https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16");
|
||||
var url = System.Text.RegularExpressions.Regex.Match(content,
|
||||
"https://download.visualstudio.microsoft.com/download/.*\\.exe").Value;
|
||||
Console.WriteLine(url);
|
||||
wc.DownloadFile(url, System.IO.Path.Combine(directory, "vs_BuildTools.exe"));
|
||||
wc.DownloadFile("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", System.IO.Path.Combine(directory, "nuget.exe"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue