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

Commit 3ed4b3b

Browse files
authored
Merge pull request #227 from getsentry/feature/only-build-tags-on-master
Only build tags on master
2 parents 037a425 + f235fe2 commit 3ed4b3b

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

build.cake

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var target = Argument("target", "Default");
99
var configuration = Argument("configuration", "Debug");
1010
var nugetOrgApiKey = EnvironmentVariable("NuGetOrgApiKey");
1111

12-
var isAppveyor = BuildSystem.IsRunningOnAppVeyor;
12+
var isAppVeyor = BuildSystem.IsRunningOnAppVeyor;
1313
var isTravis = BuildSystem.IsRunningOnTravisCI;
1414

1515
//////////////////////////////////////////////////////////////////////
@@ -50,7 +50,7 @@ var packages = new []
5050

5151
Setup(context =>
5252
{
53-
if (isAppveyor)
53+
if (isAppVeyor)
5454
{
5555
AppVeyor.UpdateBuildVersion(gitVersion.FullBuildMetaData);
5656
}
@@ -79,13 +79,9 @@ Task("RestorePackages")
7979

8080
Task("UpdateAssemblyInformation")
8181
.Description("Update assembly information using GitVersion")
82+
.WithCriteria(isAppVeyor)
8283
.Does(() =>
8384
{
84-
if (!isAppveyor)
85-
{
86-
return;
87-
}
88-
8985
GitVersion(new GitVersionSettings
9086
{
9187
UpdateAssemblyInfo = true,
@@ -155,7 +151,7 @@ Task("Test")
155151
Exclude = IsRunningOnWindows() ? null : "NuGet,NoMono",
156152
});
157153

158-
if (isAppveyor)
154+
if (isAppVeyor)
159155
{
160156
AppVeyor.UploadTestResults(resultPath, AppVeyorTestResultsType.NUnit);
161157
}
@@ -199,8 +195,16 @@ Task("PublishNuGetPackages")
199195
.IsDependentOn("Package")
200196
.WithCriteria(() =>
201197
{
198+
if (!isAppVeyor)
199+
{
200+
return false;
201+
}
202+
202203
var branchName = gitVersion.BranchName.Trim();
203-
return branchName == "master" || branchName == "develop";
204+
var taggedBuild = Convert.ToBoolean(EnvironmentVariable("APPVEYOR_REPO_TAG"));
205+
var tag = EnvironmentVariable("APPVEYOR_REPO_TAG_NAME") ?? "<no tag>";
206+
Information("{0}@{1}", branchName, tag);
207+
return taggedBuild || branchName == "develop";
204208
})
205209
.Does(() =>
206210
{

0 commit comments

Comments
 (0)