forked from whitemike889/AppCenter-SDK-Unity-Extension
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgit-release.cake
More file actions
43 lines (37 loc) · 1.35 KB
/
git-release.cake
File metadata and controls
43 lines (37 loc) · 1.35 KB
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
#addin nuget:?package=Cake.Git
#tool "nuget:?package=gitreleasemanager"
// 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-Extension";
// Build a string containing paths to NuGet packages
var files = GetFiles("output/*.unitypackage");
var assets = new List<string>();
Information("Releasing packages:");
foreach (var file in files)
{
Information(file.FullPath);
assets.Add(file.FullPath);
}
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);