-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathgit-release.cake
43 lines (37 loc) · 1.32 KB
/
git-release.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
// NOTE: This cannot be run from a Mac.
#addin nuget:?package=Cake.FileHelpers&version=2.0.0
#addin nuget:?package=Cake.Git
#tool "nuget:?package=gitreleasemanager"
#load "utility.cake"
// Task TARGET for build
var TARGET = Argument("target", Argument("t", "Default"));
Task("Default").IsDependentOn("GitRelease");
// Create a tag and release on GitHub
Task("GitRelease")
.Does(() =>
{
var specFilePath = GetFiles("UnityPackageSpecs/*.unitypackagespec").First().ToString();
var publishVersion = XmlPeek(specFilePath, "package/@version");
var username = "user";
var password = Argument<string>("GithubToken");
var owner = "Microsoft";
var repo = "AppCenter-SDK-Unity";
// Build a string containing paths to NuGet packages
var assets = new List<string>();
Information("Releasing packages:");
foreach (var file in GetBuiltPackages())
{
Information(file);
assets.Add(file);
}
GitReleaseManagerCreate(username, password, owner, repo, new GitReleaseManagerCreateSettings
{
Prerelease = false,
Assets = string.Join(",", assets),
TargetCommitish = "develop",
InputFilePath = new FilePath("RELEASE.md"),
Name = publishVersion
});
// GitReleaseManagerPublish(username, password, owner, repo, publishVersion);
});
RunTarget(TARGET);