Skip to content

Commit 3a79a49

Browse files
committed
(build) renamed the release to support branch
1 parent 20b5895 commit 3a79a49

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

build/common/Utilities/BuildContextBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ protected BuildContextBase(ICakeContext context) : base(context)
88
public BuildVersion? Version { get; set; }
99

1010
public bool IsOriginalRepo { get; set; }
11+
public string BranchName { get; set; } = string.Empty;
1112
public bool IsMainBranch { get; set; }
1213
public bool IsSupportBranch { get; set; }
1314
public bool IsPullRequest { get; set; }

build/common/Utilities/BuildLifetimeBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public override void Setup(T context)
1313
context.IsGitHubActionsBuild = buildSystem.IsRunningOnGitHubActions;
1414

1515
context.IsPullRequest = buildSystem.IsPullRequest;
16+
context.BranchName = context.GetBranchName();
1617
context.IsOriginalRepo = context.IsOriginalRepo();
1718
context.IsMainBranch = context.IsMainBranch();
1819
context.IsSupportBranch = context.IsSupportBranch();
@@ -38,6 +39,7 @@ public override void Teardown(T context, ITeardownContext info)
3839

3940
context.Information("Pull Request: {0}", context.IsPullRequest);
4041
context.Information("Original Repo: {0}", context.IsOriginalRepo);
42+
context.Information("Branch Name: {0}", context.BranchName);
4143
context.Information("Main Branch: {0}", context.IsMainBranch);
4244
context.Information("Support Branch: {0}", context.IsSupportBranch);
4345
context.Information("Tagged: {0}", context.IsTagged);
@@ -61,6 +63,7 @@ protected void LogBuildInformation(T context)
6163
context.Information("OS: {0}", context.GetOS());
6264
context.Information("Pull Request: {0}", context.IsPullRequest);
6365
context.Information("Original Repo: {0}", context.IsOriginalRepo);
66+
context.Information("Branch Name: {0}", context.BranchName);
6467
context.Information("Main Branch: {0}", context.IsMainBranch);
6568
context.Information("Support Branch: {0}", context.IsSupportBranch);
6669
context.Information("Tagged: {0}", context.IsTagged);

build/common/Utilities/ContextExtensions.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,13 @@ public static bool IsOriginalRepo(this ICakeContext context)
7474
public static bool IsMainBranch(this ICakeContext context)
7575
{
7676
var repositoryBranch = GetBranchName(context);
77-
78-
context.Information("Repository Branch: {0}", repositoryBranch);
79-
8077
return !string.IsNullOrWhiteSpace(repositoryBranch) && StringComparer.OrdinalIgnoreCase.Equals("main", repositoryBranch);
8178
}
8279

8380
public static bool IsSupportBranch(this ICakeContext context)
8481
{
8582
var repositoryBranch = GetBranchName(context);
86-
87-
context.Information("Repository Branch: {0}", repositoryBranch);
88-
89-
return !string.IsNullOrWhiteSpace(repositoryBranch) && repositoryBranch.StartsWith("suppoer/", StringComparison.OrdinalIgnoreCase);
83+
return !string.IsNullOrWhiteSpace(repositoryBranch) && repositoryBranch.StartsWith("support/", StringComparison.OrdinalIgnoreCase);
9084
}
9185

9286
public static bool IsTagged(this ICakeContext context)
@@ -172,9 +166,8 @@ public static bool ShouldRun(this ICakeContext context, bool criteria, string sk
172166
return false;
173167
}
174168

175-
private static string GetBranchName(ICakeContext context)
169+
public static string GetBranchName(this ICakeContext context)
176170
{
177-
178171
var buildSystem = context.BuildSystem();
179172
string repositoryBranch = context.ExecGitCmd("rev-parse --abbrev-ref HEAD").Single();
180173
if (buildSystem.IsRunningOnAppVeyor)

0 commit comments

Comments
 (0)