-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.cake
More file actions
48 lines (39 loc) · 1.35 KB
/
build.cake
File metadata and controls
48 lines (39 loc) · 1.35 KB
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
var target = Argument("target", "Pack");
var configuration = Argument("configuration", "Release");
var proj = $"./src/PayEx.Client/PayEx.Client.csproj";
var version = "5.0.0";
var outputDir = "./output";
Task("Build")
.Does(() => {
DotNetCoreBuild(proj, new DotNetCoreBuildSettings { Configuration = "Release" });
});
Task("Test")
.IsDependentOn("Build")
.Does(() => {
Warning("Lacking tests.");
//var testproj = $"./src/PayEx.Client/PayEx.Client.csproj";
//DotNetCoreTest(testproj);
});
Task("Pack")
.IsDependentOn("Test")
.Does(() => {
var coresettings = new DotNetCorePackSettings
{
Configuration = "Release",
OutputDirectory = outputDir,
};
coresettings.MSBuildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("Version", new[] { version });
DotNetCorePack(proj, coresettings);
});
Task("PublishToNugetOrg")
.IsDependentOn("Pack")
.Does(() => {
var settings = new DotNetCoreNuGetPushSettings
{
Source = "https://api.nuget.org/v3/index.json",
ApiKey = Argument("nugetapikey", "must-be-given")
};
DotNetCoreNuGetPush($"{outputDir}/PayEx.Client.{version}.nupkg", settings);
});
RunTarget(target);