Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

Commit

Permalink
Publish task should be dependent on integration tests task
Browse files Browse the repository at this point in the history
  • Loading branch information
hnrkndrssn committed Feb 17, 2019
1 parent 55481a6 commit 52168bd
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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(() =>
Expand Down Expand Up @@ -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")
Expand All @@ -132,7 +120,7 @@ Task("__CopyToLocalPackages")
});

Task("__RunIntegrationTests")
.IsDependentOn("__Publish")
.IsDependentOn("__Pack")
.Does(() =>
{
var sampleDir = Path.Combine("src", "ScriptCs.Octokit.Sample");
Expand All @@ -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
//////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 52168bd

Please sign in to comment.