-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.cake
34 lines (28 loc) · 895 Bytes
/
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
var target = Argument("target", "Build");
var buildId = EnvironmentVariable("GITHUB_RUN_NUMBER");
var @ref = EnvironmentVariable("GITHUB_REF");
const string prefix = "refs/tags/";
var tag = !string.IsNullOrEmpty(@ref) && @ref.StartsWith(prefix) ? @ref.Substring(prefix.Length) : null;
Task("Build")
.Does(() =>
{
var settings = new DotNetCoreBuildSettings
{
Configuration = "Release",
MSBuildSettings = new DotNetCoreMSBuildSettings()
};
if (tag != null)
{
settings.MSBuildSettings.Properties["Version"] = new[] { tag };
}
else if (buildId != null)
{
settings.VersionSuffix = "ci." + buildId;
}
foreach (var gamePlatform in new[] { "Steam", "Itch" })
{
settings.MSBuildSettings.Properties["GamePlatform"] = new[] { gamePlatform };
DotNetCoreBuild(".", settings);
}
});
RunTarget(target);