Skip to content

Commit fe17357

Browse files
committed
(build) throw error in case publish did not succeed
1 parent 00c7ad2 commit fe17357

File tree

1 file changed

+46
-10
lines changed

1 file changed

+46
-10
lines changed

build.cake

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,26 +142,62 @@ Task("Test")
142142

143143
Task("Publish-CI")
144144
.IsDependentOn("Publish-AppVeyor")
145-
.IsDependentOn("Publish-AzurePipeline");
145+
.IsDependentOn("Publish-AzurePipeline")
146+
.Finally(() =>
147+
{
148+
if (publishingError)
149+
{
150+
throw new Exception("An error occurred during the publishing of GitVersion.");
151+
}
152+
});
146153

147154
Task("Publish-Gem")
148-
.IsDependentOn("Publish-Gem-Internal");
155+
.IsDependentOn("Publish-Gem-Internal")
156+
.Finally(() =>
157+
{
158+
if (publishingError)
159+
{
160+
throw new Exception("An error occurred during the publishing of GitVersion.");
161+
}
162+
});
149163

150164
Task("Publish-NuGet")
151-
.IsDependentOn("Publish-NuGet-Internal");
165+
.IsDependentOn("Publish-NuGet-Internal")
166+
.Finally(() =>
167+
{
168+
if (publishingError)
169+
{
170+
throw new Exception("An error occurred during the publishing of GitVersion.");
171+
}
172+
});
152173

153174
Task("Publish-Chocolatey")
154-
.IsDependentOn("Publish-Chocolatey-Internal");
175+
.IsDependentOn("Publish-Chocolatey-Internal")
176+
.Finally(() =>
177+
{
178+
if (publishingError)
179+
{
180+
throw new Exception("An error occurred during the publishing of GitVersion.");
181+
}
182+
});
155183

156184
Task("Publish-Documentation")
157-
.IsDependentOn("Publish-Documentation-Internal");
185+
.IsDependentOn("Publish-Documentation-Internal")
186+
.Finally(() =>
187+
{
188+
if (publishingError)
189+
{
190+
throw new Exception("An error occurred during the publishing of GitVersion.");
191+
}
192+
});
158193

159194
Task("Publish")
160-
.IsDependentOn("Publish-CI")
161-
.IsDependentOn("Publish-NuGet")
162-
.IsDependentOn("Publish-Chocolatey")
163-
.IsDependentOn("Publish-Gem")
164-
.IsDependentOn("Publish-Documentation")
195+
.IsDependentOn("Publish-AppVeyor")
196+
.IsDependentOn("Publish-AzurePipeline")
197+
.IsDependentOn("Publish-NuGet-Internal")
198+
.IsDependentOn("Publish-Chocolatey-Internal")
199+
.IsDependentOn("Publish-Gem-Internal")
200+
.IsDependentOn("Publish-Documentation-Internal")
165201
.Finally(() =>
166202
{
167203
if (publishingError)

0 commit comments

Comments
 (0)