This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.cake
64 lines (56 loc) · 2.41 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
62
63
64
#load nuget:?package=Spectre.Build&version=0.3.0
////////////////////////////////////////////////////////
// TASKS
////////////////////////////////////////////////////////
Task("Pack-NuGet")
.PartOf(SpectreTasks.Pack)
.Does<SpectreData>(data =>
{
DotNetCorePack("./src/Spectre.Query/Spectre.Query.csproj", new DotNetCorePackSettings {
Configuration = data.Configuration,
OutputDirectory = data.Paths.NuGetPackages,
NoRestore = true,
NoBuild = true,
MSBuildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("Version", data.Version.SemanticVersion)
.WithProperty("AssemblyVersion", data.Version.MajorMinorPatchRevision)
.WithProperty("FileVersion", data.Version.MajorMinorPatchRevision)
.WithProperty("PackageVersion", data.Version.SemanticVersion)
});
DotNetCorePack("./src/Spectre.Query.AspNetCore/Spectre.Query.AspNetCore.csproj", new DotNetCorePackSettings {
Configuration = data.Configuration,
OutputDirectory = data.Paths.NuGetPackages,
NoRestore = true,
NoBuild = true,
MSBuildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("Version", data.Version.SemanticVersion)
.WithProperty("AssemblyVersion", data.Version.MajorMinorPatchRevision)
.WithProperty("FileVersion", data.Version.MajorMinorPatchRevision)
.WithProperty("PackageVersion", data.Version.SemanticVersion)
});
});
Task("Create-Release")
.WithCriteria<SpectreData>((context, data) => !data.CI.IsLocal, "Not running locally")
.Does<SpectreData>((context, data) =>
{
var username = context.Argument<string>("github-username", null);
var password = context.Argument<string>("github-password", null);
if (string.IsNullOrWhiteSpace(username) ||
string.IsNullOrWhiteSpace(password))
{
throw new InvalidOperationException("No GitHub credentials has been provided.");
}
context.GitReleaseManagerCreate(
username,
password,
"spectresystems", "spectre.query",
new GitReleaseManagerCreateSettings {
Milestone = $"v{data.Version.MajorMinorPatch}",
Name = $"v{data.Version.MajorMinorPatch}",
TargetCommitish = "master"
});
});
////////////////////////////////////////////////////////
// EXECUTION
////////////////////////////////////////////////////////
Spectre.Build();