Skip to content

Commit 57deccb

Browse files
committed
Append git version to release package zip file
1 parent 610d921 commit 57deccb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

build.cake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#addin nuget:?package=Cake.Compression&version=0.2.4
22
#addin nuget:?package=SharpZipLib&version=1.2.0
3+
#tool "nuget:?package=GitVersion.CommandLine&version=5.2.4"
34

45
//////////////////////////////////////////////////////////////////////
56
// ARGUMENTS
@@ -37,7 +38,6 @@ Task("Clean")
3738
.Does(() => {
3839
CleanDirectory(buildDir);
3940
CleanDirectory(publishDir);
40-
CleanDirectories("./src/**/bin");
4141
CleanDirectories("./src/**/obj");
4242
});
4343

@@ -272,6 +272,12 @@ Task("Publish-Common")
272272
.IsDependentOn("Generate-MigrationScript")
273273
.IsDependentOn("Run-FrontendBuild");
274274

275+
string GetVersionString() {
276+
var version = GitVersion();
277+
278+
return version.NuGetVersion;
279+
}
280+
275281
var windowsAllPublishTask = Task("Publish-Windows");
276282

277283
void WindowsPublishTask(string taskId, string versionId, string description) {
@@ -283,7 +289,7 @@ void WindowsPublishTask(string taskId, string versionId, string description) {
283289
.IsDependentOn("Publish-Common")
284290
.Does(() => PublishSelfContained(versionId, $"{versionId}/app"));
285291

286-
var output = publishDir + File($"return-web-{versionId}.zip");
292+
var output = publishDir + File($"return-web-{versionId}-{GetVersionString()}.zip");
287293
Task(taskName)
288294
.IsDependentOn(internalTaskName)
289295
.Description($"Publish for {description}, output to {output}")
@@ -308,7 +314,7 @@ void UbuntuPublishTask(string taskId, string versionId, string description) {
308314
.IsDependentOn("Publish-Common")
309315
.Does(() => PublishSelfContained(versionId, $"{versionId}/app"));
310316

311-
var output = publishDir + File($"return-web-{versionId}.tar.gz");
317+
var output = publishDir + File($"return-web-{versionId}-{GetVersionString()}.tar.gz");
312318
Task(taskName)
313319
.IsDependentOn(internalTaskName)
314320
.Description($"Publish for {description}, output to {output}")

0 commit comments

Comments
 (0)