-
Notifications
You must be signed in to change notification settings - Fork 39
/
recipe.cake
64 lines (50 loc) · 3.03 KB
/
recipe.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=Cake.Recipe&version=3.1.1
#tool dotnet:?package=dotnet-t4&version=2.2.1
#addin nuget:?package=Cake.Git&version=1.0.0
Environment.SetVariableNames(githubTokenVariable: "GITTOOLS_GITHUB_TOKEN");
var standardNotificationMessage = "A new version, {0} of {1} has just been released. Get it from Chocolatey, NuGet, or as a .Net Global Tool.";
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "GitReleaseManager",
repositoryOwner: "GitTools",
repositoryName: "GitReleaseManager",
appVeyorAccountName: "GitTools",
shouldRunDotNetCorePack: true,
shouldRunIntegrationTests: true,
integrationTestScriptPath: "./tests/integration/tests.cake",
twitterMessage: standardNotificationMessage,
preferredBuildProviderType: BuildProviderType.GitHubActions,
gitterMessage: "@/all " + standardNotificationMessage,
shouldRunCodecov: false);
BuildParameters.PackageSources.Add(new PackageSourceData(Context, "GPR", "https://nuget.pkg.github.com/GitTools/index.json", FeedType.NuGet, false));
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context,
testCoverageFilter: "+[GitReleaseManager*]* -[GitReleaseManager.Core.Tests*]* -[GitReleaseManager.Tests*]*",
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs",
kuduSyncIgnore: ".git;CNAME;_git2");
BuildParameters.Tasks.DotNetCoreBuildTask.Does((context) =>
{
var buildDir = BuildParameters.Paths.Directories.PublishedApplications;
var grmExecutable = context.GetFiles(buildDir + "/**/*.exe").First();
context.Information("Registering Built GRM executable...");
context.Tools.RegisterFile(grmExecutable);
});
BuildParameters.Tasks.CreateReleaseNotesTask
.IsDependentOn(BuildParameters.Tasks.DotNetCoreBuildTask); // We need to be sure that the executable exist, and have been registered before using it
Task("Transform-TextTemplates")
.IsDependeeOf(BuildParameters.Tasks.DotNetCoreBuildTask.Task.Name)
.Does(() =>
{
var templates = GetFiles("src/**/*.tt");
foreach (var template in templates)
{
TransformTemplate(template);
}
});
((CakeTask)BuildParameters.Tasks.ExportReleaseNotesTask.Task).ErrorHandler = null;
((CakeTask)BuildParameters.Tasks.PublishGitHubReleaseTask.Task).ErrorHandler = null;
BuildParameters.Tasks.PublishPreReleasePackagesTask.IsDependentOn(BuildParameters.Tasks.PublishGitHubReleaseTask);
BuildParameters.Tasks.PublishReleasePackagesTask.IsDependentOn(BuildParameters.Tasks.PublishGitHubReleaseTask);
Build.RunDotNetCore();