Skip to content

Commit e84ad6c

Browse files
committed
Disable applying tags for alpha builds
1 parent 4594bda commit e84ad6c

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

recipe/publishing.cake

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static class PackageReleaseManager
4141

4242
try
4343
{
44-
ApplyReleaseTagToBuild(BuildSettings.PackageVersion);
44+
//ApplyReleaseTagToBuild(BuildSettings.PackageVersion);
4545

4646
if (publishToMyGet)
4747
if (packageType == PackageType.NuGet)
@@ -66,36 +66,36 @@ public static class PackageReleaseManager
6666
throw new Exception("One of the publishing steps failed.");
6767
}
6868

69-
public static void ApplyReleaseTagToBuild(string releaseTag)
70-
{
71-
_context.Information($"Applying release tag {releaseTag}...");
72-
73-
string currentTag = _context.GitDescribe(BuildSettings.ProjectDirectory, GitDescribeStrategy.Tags);
74-
if (currentTag == releaseTag)
75-
{
76-
_context.Warning(" Tag already set on HEAD, possibly in a prior run.");
77-
return;
78-
}
79-
80-
try
81-
{
82-
_context.GitTag(BuildSettings.ProjectDirectory, releaseTag);
83-
_context.Information($" Release tagged as {releaseTag}.");
84-
85-
if (releaseTag.Contains("-alpha."))
86-
{
87-
_context.GitPushRef(BuildSettings.ProjectDirectory, BuildSettings.GitHubOwner, BuildSettings.GitHubAccessToken, "origin", releaseTag);
88-
_context.Information($" Release tag {releaseTag} was pushed to origin.");
89-
}
90-
}
91-
catch (Exception ex)
92-
{
93-
if (!ex.Message.ToLower().Contains("tag already exists"))
94-
throw;
95-
96-
throw new Exception($"The {releaseTag} tag was used on an earlier commit. If no packages have been published, you may be able to remove that tag. Otherwise, you should advance the release version before proceeding.", ex);
97-
}
98-
}
69+
//public static void ApplyReleaseTagToBuild(string releaseTag)
70+
//{
71+
// _context.Information($"Applying release tag {releaseTag}...");
72+
73+
// string currentTag = _context.GitDescribe(BuildSettings.ProjectDirectory, GitDescribeStrategy.Tags);
74+
// if (currentTag == releaseTag)
75+
// {
76+
// _context.Warning(" Tag already set on HEAD, possibly in a prior run.");
77+
// return;
78+
// }
79+
80+
// try
81+
// {
82+
// _context.GitTag(BuildSettings.ProjectDirectory, releaseTag);
83+
// _context.Information($" Release tagged as {releaseTag}.");
84+
85+
// if (releaseTag.Contains("-alpha."))
86+
// {
87+
// _context.GitPushRef(BuildSettings.ProjectDirectory, BuildSettings.GitHubOwner, BuildSettings.GitHubAccessToken, "origin", releaseTag);
88+
// _context.Information($" Release tag {releaseTag} was pushed to origin.");
89+
// }
90+
// }
91+
// catch (Exception ex)
92+
// {
93+
// if (!ex.Message.ToLower().Contains("tag already exists"))
94+
// throw;
95+
96+
// throw new Exception($"The {releaseTag} tag was used on an earlier commit. If no packages have been published, you may be able to remove that tag. Otherwise, you should advance the release version before proceeding.", ex);
97+
// }
98+
//}
9999

100100
/// <summary>
101101
/// Re-publish a symbol package after a failure. Must specify --where

0 commit comments

Comments
 (0)