Skip to content

Commit 5ad3173

Browse files
authored
Merge pull request #977 from JakeGinnivan/BuildScriptUpdates
Throw if for some reason we are missing any artifacts. Do not upload pre-release to VSTS. Fixes #961.
2 parents 9756b9d + 9846b20 commit 5ad3173

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

deploy.cake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ Task("DownloadGitHubReleaseArtifacts")
6363
.ReadAllLines("./releaseArtifacts/artifacts")
6464
.Select(l => l.Split(':'))
6565
.ToDictionary(v => v[0], v => v[1]);
66+
67+
// Have had missing artifacts before, lets fail early in that scenario
68+
if (!artifactLookup.ContainsKey("NuGetRefBuild")) { throw new Exception("NuGetRefBuild" artifact missing); }
69+
if (!artifactLookup.ContainsKey("NuGetCommandLineBuild")) { throw new Exception("NuGetCommandLineBuild" artifact missing); }
70+
if (!artifactLookup.ContainsKey("NuGetTaskBuild")) { throw new Exception("NuGetTaskBuild" artifact missing); }
71+
if (!artifactLookup.ContainsKey("NuGetExeBuild")) { throw new Exception("NuGetExeBuild" artifact missing); }
72+
if (!artifactLookup.ContainsKey("GemBuild")) { throw new Exception("GemBuild" artifact missing); }
73+
if (!artifactLookup.ContainsKey("GitVersionTfsTaskBuild")) { throw new Exception("GitVersionTfsTaskBuild" artifact missing); }
6674
});
6775

6876
Task("Publish-NuGetPackage")
@@ -152,6 +160,7 @@ Task("Publish-Gem")
152160

153161
Task("Publish-VstsTask")
154162
.IsDependentOn("DownloadGitHubReleaseArtifacts")
163+
.WithCriteria(() => !tag.Contains("-")) // Do not release pre-release to VSTS
155164
.Does(() =>
156165
{
157166
var returnCode = StartProcess("cmd", new ProcessSettings

0 commit comments

Comments
 (0)