Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #227 from getsentry/feature/only-build-tags-on-master
Browse files Browse the repository at this point in the history
Only build tags on master
  • Loading branch information
asbjornu authored Mar 11, 2018
2 parents 037a425 + f235fe2 commit 3ed4b3b
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var target = Argument("target", "Default");
var configuration = Argument("configuration", "Debug");
var nugetOrgApiKey = EnvironmentVariable("NuGetOrgApiKey");

var isAppveyor = BuildSystem.IsRunningOnAppVeyor;
var isAppVeyor = BuildSystem.IsRunningOnAppVeyor;
var isTravis = BuildSystem.IsRunningOnTravisCI;

//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -50,7 +50,7 @@ var packages = new []

Setup(context =>
{
if (isAppveyor)
if (isAppVeyor)
{
AppVeyor.UpdateBuildVersion(gitVersion.FullBuildMetaData);
}
Expand Down Expand Up @@ -79,13 +79,9 @@ Task("RestorePackages")

Task("UpdateAssemblyInformation")
.Description("Update assembly information using GitVersion")
.WithCriteria(isAppVeyor)
.Does(() =>
{
if (!isAppveyor)
{
return;
}
GitVersion(new GitVersionSettings
{
UpdateAssemblyInfo = true,
Expand Down Expand Up @@ -155,7 +151,7 @@ Task("Test")
Exclude = IsRunningOnWindows() ? null : "NuGet,NoMono",
});
if (isAppveyor)
if (isAppVeyor)
{
AppVeyor.UploadTestResults(resultPath, AppVeyorTestResultsType.NUnit);
}
Expand Down Expand Up @@ -199,8 +195,16 @@ Task("PublishNuGetPackages")
.IsDependentOn("Package")
.WithCriteria(() =>
{
if (!isAppVeyor)
{
return false;
}
var branchName = gitVersion.BranchName.Trim();
return branchName == "master" || branchName == "develop";
var taggedBuild = Convert.ToBoolean(EnvironmentVariable("APPVEYOR_REPO_TAG"));
var tag = EnvironmentVariable("APPVEYOR_REPO_TAG_NAME") ?? "<no tag>";
Information("{0}@{1}", branchName, tag);
return taggedBuild || branchName == "develop";
})
.Does(() =>
{
Expand Down

0 comments on commit 3ed4b3b

Please sign in to comment.