Skip to content

Commit

Permalink
Merge pull request #1001 from kekekeks/release-branches
Browse files Browse the repository at this point in the history
Allow publishing to nuget from non-release branches
  • Loading branch information
kekekeks committed May 31, 2017
2 parents df1aed4 + ecd64c8 commit 3773850
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ Task("Publish-NuGet")
.WithCriteria(() => !parameters.IsLocalBuild)
.WithCriteria(() => !parameters.IsPullRequest)
.WithCriteria(() => parameters.IsMainRepo)
.WithCriteria(() => parameters.IsMasterBranch)
.WithCriteria(() => parameters.IsNuGetRelease)
.Does(() =>
{
Expand Down
14 changes: 11 additions & 3 deletions parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,25 @@ public class Parameters
IsReleasable = StringComparer.OrdinalIgnoreCase.Equals(ReleasePlatform, Platform)
&& StringComparer.OrdinalIgnoreCase.Equals(ReleaseConfiguration, Configuration);
IsMyGetRelease = !IsTagged && IsReleasable;
IsNuGetRelease = IsTagged && IsReleasable;


// VERSION
Version = context.Argument("force-nuget-version", context.ParseAssemblyInfo(AssemblyInfoPath).AssemblyVersion);

if (IsRunningOnAppVeyor)
{
string tagVersion = null;
if (IsTagged)
{
// Use Tag Name as version
Version = buildSystem.AppVeyor.Environment.Repository.Tag.Name;
var tag = buildSystem.AppVeyor.Environment.Repository.Tag.Name;
var nugetReleasePrefix = "nuget-release-";
IsNuGetRelease = IsTagged && IsReleasable && tag.StartsWith(nugetReleasePrefix);
if(IsNuGetRelease)
tagVersion = tag.Substring(nugetReleasePrefix.Length);
}
if(tagVersion != null)
{
Version = tagVersion;
}
else
{
Expand Down

0 comments on commit 3773850

Please sign in to comment.