Skip to content

Commit

Permalink
Prepare build for GitReleaseManager
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Feb 11, 2018
1 parent 7de642a commit f48f2a0
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 8 deletions.
27 changes: 27 additions & 0 deletions GitReleaseManager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
create:
include-footer: true
footer-heading: Where to get it
footer-content: You can download this release from [MahApps.Metro](https://github.com/MahApps/MahApps.Metro/releases/{milestone})
footer-includes-milestone: true
milestone-replace-text: '{milestone}'
export:
include-created-date-in-title: true
created-date-string-format: MMMM dd, yyyy
perform-regex-removal: true
regex-text: '### Where to get it(\r\n)*You can .*\)'
multiline-regex: true
issue-labels-include:
- Breaking change
- Bug
- Feature
- Feature Request
issue-labels-exclude:
- Internal Refactoring
- Build
- Question
- WontFix
- Duplicate
issue-labels-alias:
- name: Documentation
header: Documentation
plural: Documentation
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ branches:
develop:
mode: ContinuousDeployment
tag: alpha
increment: Minor
increment: Patch
prevent-increment-of-merged-branch-version: false
track-merge-target: true
pull-request:
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
image: Visual Studio 2017
configuration: Release
platform: Any CPU
test: off

pull_requests:
do_not_increment_build_number: false
Expand Down
47 changes: 40 additions & 7 deletions src/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,24 @@ if (string.IsNullOrWhiteSpace(configuration))

// Set build version
GitVersion(new GitVersionSettings { OutputType = GitVersionOutput.BuildServer });
GitVersion gitVersion;

// Define directories.
var buildDir = Directory("./bin");

var username = "";
var password = "";

//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Setup(context =>
{
gitVersion = GitVersion(new GitVersionSettings { OutputType = GitVersionOutput.Json });
Information("Informational Version: {0}", gitVersion.InformationalVersion);
Information("SemVer Version: {0}", gitVersion.SemVer);

Information(Figlet("MahApps.Metro"));
});

Expand Down Expand Up @@ -79,27 +87,52 @@ Task("Paket-Pack")
//.WithCriteria(ShouldRunRelease())
.Does(() =>
{
var version = GitVersion();
EnsureDirectoryExists("./Publish");
PaketPack("./Publish", new PaketPackSettings { Version = version.NuGetVersion });
PaketPack("./Publish", new PaketPackSettings { Version = gitVersion.NuGetVersion });
});

Task("Zip-Demos")
//.WithCriteria(ShouldRunRelease())
.Does(() =>
{
var version = GitVersion();
EnsureDirectoryExists("./Publish");
Zip("./bin/MetroDemo/", "./Publish/MetroDemo-v" + version.NuGetVersion + ".zip");
Zip("./bin/Caliburn.Metro.Demo/", "./Publish/Caliburn.MetroDemo-v" + version.NuGetVersion + ".zip");
Zip("./bin/MetroDemo/", "./Publish/MetroDemo-v" + gitVersion.NuGetVersion + ".zip");
Zip("./bin/Caliburn.Metro.Demo/", "./Publish/Caliburn.MetroDemo-v" + gitVersion.NuGetVersion + ".zip");
});

Task("Unit-Tests")
//.WithCriteria(ShouldRunRelease())
.Does(() =>
{
XUnit("./Mahapps.Metro.Tests/**/bin/" + configuration + "/*.Tests.dll",
new XUnitSettings { ToolPath = "./packages/cake/xunit.runner.console/tools/net452/xunit.console.exe" });
XUnit(
"./Mahapps.Metro.Tests/**/bin/" + configuration + "/*.Tests.dll",
new XUnitSettings { ToolPath = "./packages/cake/xunit.runner.console/tools/net452/xunit.console.exe" }
);
});

Task("GetCredentials")
.Does(() =>
{
username = EnvironmentVariable("GITHUB_USERNAME_MAHAPPS");
password = EnvironmentVariable("GITHUB_PASSWORD_MAHAPPS");
});

Task("CreateReleaseNotes")
.Does(() =>
{
EnsureDirectoryExists("./Publish");
// GitReleaseManagerExport(username, password, "MahApps", "MahApps.Metro", "./Publish/releasenotes.md", new GitReleaseManagerExportSettings {
// TagName = "1.5.0",
// TargetDirectory = "./Publish",
// LogFilePath = "./Publish/grm.log"
// });
GitReleaseManagerCreate(username, password, "MahApps", "MahApps.Metro", new GitReleaseManagerCreateSettings {
Milestone = gitVersion.MajorMinorPatch,
Name = gitVersion.SemVer,
Prerelease = false,
TargetCommitish = "master",
WorkingDirectory = "../"
});
});

//////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit f48f2a0

Please sign in to comment.