From 52168bd95ca8a46e5afa0bb04e832b9a95bf55cc Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sun, 17 Feb 2019 17:28:14 +1000 Subject: [PATCH] Publish task should be dependent on integration tests task --- build.cake | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/build.cake b/build.cake index 3caa510..b98deaf 100644 --- a/build.cake +++ b/build.cake @@ -52,9 +52,9 @@ Task("__Default") .IsDependentOn("__Restore") .IsDependentOn("__Build") .IsDependentOn("__Pack") - .IsDependentOn("__Publish") .IsDependentOn("__CopyToLocalPackages") - .IsDependentOn("__RunIntegrationTests"); + .IsDependentOn("__RunIntegrationTests") + .IsDependentOn("__Publish"); Task("__Clean") .Does(() => @@ -110,18 +110,6 @@ Task("__Pack") }); }); -var isTag = bool.Parse(EnvironmentVariable("APPVEYOR_REPO_TAG") ?? "false"); -Task("__Publish") - .WithCriteria(isTag) - .WithCriteria(BuildSystem.IsRunningOnAppVeyor) - .Does(() => -{ - NuGetPush($"{artifactsDir}/{projectName}.{nugetVersion}.nupkg", new NuGetPushSettings { - Source = "https://www.nuget.org/api/v2/package", - ApiKey = EnvironmentVariable("NuGetApiKey") - }); -}); - Task("__CopyToLocalPackages") .WithCriteria(BuildSystem.IsLocalBuild) .IsDependentOn("__Pack") @@ -132,7 +120,7 @@ Task("__CopyToLocalPackages") }); Task("__RunIntegrationTests") - .IsDependentOn("__Publish") + .IsDependentOn("__Pack") .Does(() => { var sampleDir = Path.Combine("src", "ScriptCs.Octokit.Sample"); @@ -148,6 +136,19 @@ Task("__RunIntegrationTests") throw new Exception($"Running integration tests failed, see above for failure details."); }); +var isTag = bool.Parse(EnvironmentVariable("APPVEYOR_REPO_TAG") ?? "false"); +Task("__Publish") + .WithCriteria(isTag) + .WithCriteria(BuildSystem.IsRunningOnAppVeyor) + .IsDependentOn("__RunIntegrationTests") + .Does(() => +{ + NuGetPush($"{artifactsDir}/{projectName}.{nugetVersion}.nupkg", new NuGetPushSettings { + Source = "https://www.nuget.org/api/v2/package", + ApiKey = EnvironmentVariable("NuGetApiKey") + }); +}); + ////////////////////////////////////////////////////////////////////// // TASKS //////////////////////////////////////////////////////////////////////