-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.cake
39 lines (29 loc) · 1.25 KB
/
build.cake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#tool nuget:?package=GitVersion.CommandLine&prerelease
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var projectName = "SpriteFactory";
var solution = $"./{projectName}.sln";
var gitVersion = GitVersion();
Information($"##teamcity[buildNumber '{gitVersion.FullSemVer}']");
TaskSetup(context => Information($"##teamcity[blockOpened name='{context.Task.Name}']"));
TaskTeardown(context => Information($"##teamcity[blockClosed name='{context.Task.Name}']"));
Task("Publish")
.Does(() =>
{
Information("##teamcity[progressMessage 'Publishing...']");
var artifactsDirectory = "./artifacts";
var outputDirectory = $"{artifactsDirectory}/{projectName}-v{gitVersion.SemVer}";
var settings = new DotNetCorePublishSettings
{
NoRestore = true,
Configuration = configuration,
OutputDirectory = outputDirectory,
ArgumentCustomization = args => args.Append($"/p:Version={gitVersion.AssemblySemVer}")
};
CleanDirectory(artifactsDirectory);
DotNetCorePublish($"./{projectName}/{projectName}.csproj", settings);
Zip(outputDirectory, $"{outputDirectory}.zip");
});
Task("Default")
.IsDependentOn("Publish");
RunTarget(target);