-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cake
61 lines (53 loc) · 2.14 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
59
60
61
var target = Argument("Target", "Default");
var nuGetApiKey = Argument("NuGetApiKey", "NOT SET");
var buildDirectory = Directory("./bin");
var version = Argument("Version", "0.0.1");
Task("Clean")
.Does(() => {
CleanDirectory(buildDirectory);
});
Task("Build")
.IsDependentOn("Clean")
.Does(() => {
DownloadFile("http://download.red-gate.com/SQLCodeGuardCmdLine.zip", "./bin/SqlCodeGuard.zip");
Unzip("./bin/SQLCodeGuard.zip", "./bin/SQLCodeGuard");
});
Task("Package")
.IsDependentOn("Build")
.Does(() => {
var nuGetPackSettings = new NuGetPackSettings {
Id = "SqlCodeGuard.Console",
Version = version,
Title = "SqlCodeGuard.Console",
Authors = new[] {"Tanner Watson"},
Description = "Packaged RedGate's SQL Code Guard command line tools.",
ProjectUrl = new Uri("https://github.com/tannerwatson/SqlCodeGuard.Console/"),
Tags = new [] {"cake", "sqlcodeguard", "build", "redgate"},
RequireLicenseAcceptance = false,
Files = new [] {
new NuSpecContent {Source = "./License.rtf", Target = "tools"},
new NuSpecContent {Source = "./Microsoft.SqlServer.TransactSql.ScriptDom.dll", Target = "tools"},
new NuSpecContent {Source = "./SampleProject.msbuild", Target = "tools"},
new NuSpecContent {Source = "./SqlCodeGuard30.API.dll", Target = "tools"},
new NuSpecContent {Source = "./SqlCodeGuard30.Cmd.exe", Target = "tools"},
new NuSpecContent {Source = "./SqlCodeGuard30.Core.dll", Target = "tools"},
new NuSpecContent {Source = "./SqlCodeGuard30.MSBuild.dll", Target = "tools"},
new NuSpecContent {Source = "./SqlCodeGuard30.Ouroboros.dll", Target = "tools"},
},
BasePath = Directory("./bin/SqlCodeGuard"),
OutputDirectory = buildDirectory
};
NuGetPack(nuGetPackSettings);
});
Task("Publish")
.IsDependentOn("Package")
.Does(() => {
var package = File($"./bin/SqlCodeGuard.Console.{version}.nupkg");
NuGetPush(package, new NuGetPushSettings {
Source = "https://api.nuget.org/v3/index.json",
ApiKey = nuGetApiKey
});
});
Task("Default")
.IsDependentOn("Package");
RunTarget(target);