-
Notifications
You must be signed in to change notification settings - Fork 52
/
build.cake
49 lines (41 loc) · 1.18 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
40
41
42
43
44
45
46
47
48
49
var target = Argument("target", "Default");
var workflow = BuildSystem.GitHubActions.Environment.Workflow;
var buildId = workflow.RunNumber;
var tag = workflow.RefType == GitHubActionsRefType.Tag ? workflow.RefName : null;
Task("Build-ReleaseFull")
.Does(() =>
{
var settings = new DotNetBuildSettings
{
Configuration = "ReleaseFull",
MSBuildSettings = new DotNetMSBuildSettings()
};
UpdateBuildSettings(settings, tag, buildId);
DotNetBuild(".", settings);
});
Task("Build-ReleaseDataCollection")
.Does(() =>
{
var settings = new DotNetBuildSettings
{
Configuration = "ReleaseDataCollection",
MSBuildSettings = new DotNetMSBuildSettings()
};
UpdateBuildSettings(settings, tag, buildId);
DotNetBuild(".", settings);
});
Task("Default")
.IsDependentOn("Build-ReleaseFull")
.IsDependentOn("Build-ReleaseDataCollection");
RunTarget(target);
void UpdateBuildSettings(DotNetBuildSettings settings, string tag, int buildId)
{
if (tag != null)
{
settings.MSBuildSettings.Version = tag;
}
else if (buildId != 0)
{
settings.MSBuildSettings.VersionSuffix = "ci." + buildId;
}
}