forked from FoxCouncil/Steamworks.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
58 lines (44 loc) · 1.36 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
50
51
52
53
54
55
56
57
58
var json = "./project.json";
var target = Argument ("target", "Default");
Task ("Default").IsDependentOn ("build").IsDependentOn ("push");
Task ("build").IsDependentOn ("clean").Does (() =>
{
DotNetCoreRestore();
// Always use Jenkins configuration never Debug or Release they will bump version numbers.
var buildSettings = new DotNetCoreBuildSettings
{
Configuration = "Jenkins"
};
DotNetCoreBuild(json, buildSettings);
// Create packing settings for .NET core.
var packSettings = new DotNetCorePackSettings {
Configuration = "Jenkins",
OutputDirectory = "nupkg",
Verbose = true,
NoBuild = true
};
DotNetCorePack(json, packSettings);
});
Task ("push").Does (() =>
{
// Get the newest (by last write time) to publish
var newestNupkg = GetFiles ("nupkg/*.nupkg")
.OrderBy (f => new System.IO.FileInfo (f.FullPath).LastWriteTimeUtc)
.LastOrDefault ();
var apiKey = TransformTextFile ("./.nugetapi.key").ToString();
var nugetSettings = new NuGetPushSettings {
Verbosity = NuGetVerbosity.Detailed,
ApiKey = apiKey,
Source = "https://www.nuget.org/api/v2/package"
};
NuGetPush (newestNupkg, nugetSettings);
});
Task ("clean").Does (() =>
{
CleanDirectories ("./**/bin");
CleanDirectories ("./**/obj");
CleanDirectories ("./**/Components");
//CleanDirectories ("./**/tools");
DeleteFiles ("./**/*.apk");
});
RunTarget (target);