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

Commit 52168bd

Browse files
committed
Publish task should be dependent on integration tests task
1 parent 55481a6 commit 52168bd

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

build.cake

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ Task("__Default")
5252
.IsDependentOn("__Restore")
5353
.IsDependentOn("__Build")
5454
.IsDependentOn("__Pack")
55-
.IsDependentOn("__Publish")
5655
.IsDependentOn("__CopyToLocalPackages")
57-
.IsDependentOn("__RunIntegrationTests");
56+
.IsDependentOn("__RunIntegrationTests")
57+
.IsDependentOn("__Publish");
5858

5959
Task("__Clean")
6060
.Does(() =>
@@ -110,18 +110,6 @@ Task("__Pack")
110110
});
111111
});
112112

113-
var isTag = bool.Parse(EnvironmentVariable("APPVEYOR_REPO_TAG") ?? "false");
114-
Task("__Publish")
115-
.WithCriteria(isTag)
116-
.WithCriteria(BuildSystem.IsRunningOnAppVeyor)
117-
.Does(() =>
118-
{
119-
NuGetPush($"{artifactsDir}/{projectName}.{nugetVersion}.nupkg", new NuGetPushSettings {
120-
Source = "https://www.nuget.org/api/v2/package",
121-
ApiKey = EnvironmentVariable("NuGetApiKey")
122-
});
123-
});
124-
125113
Task("__CopyToLocalPackages")
126114
.WithCriteria(BuildSystem.IsLocalBuild)
127115
.IsDependentOn("__Pack")
@@ -132,7 +120,7 @@ Task("__CopyToLocalPackages")
132120
});
133121

134122
Task("__RunIntegrationTests")
135-
.IsDependentOn("__Publish")
123+
.IsDependentOn("__Pack")
136124
.Does(() =>
137125
{
138126
var sampleDir = Path.Combine("src", "ScriptCs.Octokit.Sample");
@@ -148,6 +136,19 @@ Task("__RunIntegrationTests")
148136
throw new Exception($"Running integration tests failed, see above for failure details.");
149137
});
150138

139+
var isTag = bool.Parse(EnvironmentVariable("APPVEYOR_REPO_TAG") ?? "false");
140+
Task("__Publish")
141+
.WithCriteria(isTag)
142+
.WithCriteria(BuildSystem.IsRunningOnAppVeyor)
143+
.IsDependentOn("__RunIntegrationTests")
144+
.Does(() =>
145+
{
146+
NuGetPush($"{artifactsDir}/{projectName}.{nugetVersion}.nupkg", new NuGetPushSettings {
147+
Source = "https://www.nuget.org/api/v2/package",
148+
ApiKey = EnvironmentVariable("NuGetApiKey")
149+
});
150+
});
151+
151152
//////////////////////////////////////////////////////////////////////
152153
// TASKS
153154
//////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)