-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.cake
55 lines (48 loc) · 1.12 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
var target = Argument("target", "Default");
var nugetArtifactsPath = "./artifacts/NuGet";
Task("Restore")
.Does(() => {
DotNetCoreRestore("src");
});
Task("Build")
.IsDependentOn("Restore")
.Does(() => {
DotNetCoreBuild("src",
new DotNetCoreBuildSettings
{
NoRestore = true
});
});
Task("Test")
.IsDependentOn("Build")
.Does(() => {
DotNetCoreTest("src",
new DotNetCoreTestSettings
{
NoRestore = true,
NoBuild = true
});
});
Task("Package")
.IsDependentOn("Test")
.Does(() => {
DotNetCorePack("src",
new DotNetCorePackSettings
{
NoRestore = true,
NoBuild = true,
OutputDirectory = nugetArtifactsPath
});
});
Task("Publish")
.IsDependentOn("Package")
.WithCriteria(TFBuild.IsRunningOnAzurePipelinesHosted)
.Does(() => {
TFBuild.Commands.UploadArtifactDirectory(
nugetArtifactsPath,
"NuGet"
);
});
Task("Default")
.IsDependentOn("Publish");
RunTarget(target);