From 93b3b06e54d5ca620379b1667358cd02a7df402b Mon Sep 17 00:00:00 2001 From: AeonLucid Date: Mon, 19 Oct 2020 11:57:10 +0200 Subject: [PATCH] Update cake script --- build.cake | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/build.cake b/build.cake index c19b822..b1cccf4 100644 --- a/build.cake +++ b/build.cake @@ -1,6 +1,8 @@ var buildVersion = EnvironmentVariable("APPVEYOR_BUILD_VERSION") ?? "1.0.0"; var buildDir = MakeAbsolute(Directory("./build")); +var branch = EnvironmentVariable("APPVEYOR_REPO_BRANCH") ?? "dev"; +var prNumber = EnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER"); var target = Argument("target", "Deploy"); var configuration = Argument("configuration", "Release"); @@ -69,15 +71,29 @@ Task("Build") Configuration = configuration, }); - // Client. - ImpostorPublishNF("Impostor-Patcher", "./src/Impostor.Client/Impostor.Patcher.WinForms/Impostor.Patcher.WinForms.csproj"); - - // Server. - ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "win-x64"); - ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "osx-x64"); - ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "linux-x64"); - ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "linux-arm"); - ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "linux-arm64"); + if ((branch == "master" || branch == "dev") && !string.IsNullOrEmpty(prNumber)) { + // Client. + ImpostorPublishNF("Impostor-Patcher", "./src/Impostor.Patcher/Impostor.Patcher.WinForms/Impostor.Patcher.WinForms.csproj"); + + // Server. + ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "win-x64"); + ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "osx-x64"); + ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "linux-x64"); + ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "linux-arm"); + ImpostorPublish("Impostor-Server", "./src/Impostor.Server/Impostor.Server.csproj", "linux-arm64"); + } else { + DotNetCoreBuild("./src/Impostor.Patcher/Impostor.Patcher.WinForms/Impostor.Patcher.WinForms.csproj", new DotNetCoreBuildSettings { + Configuration = configuration, + NoRestore = true, + Framework = "net472" + }); + + DotNetCoreBuild("./src/Impostor.Server/Impostor.Server.csproj", new DotNetCoreBuildSettings { + Configuration = configuration, + NoRestore = true, + Framework = "net5.0" + }); + } }); Task("Test") -- 2.39.5