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

Commit db09218

Browse files
committed
Merge branch 'develop'
* develop: Various AppVeyor fixes
2 parents 43bfbc5 + 0e651f7 commit db09218

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

build.cake

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#tool "nuget:?package=GitVersion.CommandLine"
33

44
//////////////////////////////////////////////////////////////////////
5-
// ARGUMENTS
5+
// ARGUMENTS AND ENVIRONMENT VARIABLES
66
//////////////////////////////////////////////////////////////////////
77

88
var target = Argument("target", "Default");
99
var configuration = Argument("configuration", "Debug");
1010
var nugetOrgApiKey = EnvironmentVariable("NuGetOrgApiKey");
11+
var isTaggedBuild = Convert.ToBoolean(EnvironmentVariable("APPVEYOR_REPO_TAG"));
12+
var tag = EnvironmentVariable("APPVEYOR_REPO_TAG_NAME") ?? "<no tag>";
1113

1214
var isAppVeyor = BuildSystem.IsRunningOnAppVeyor;
1315
var isTravis = BuildSystem.IsRunningOnTravisCI;
@@ -43,19 +45,29 @@ var packages = new []
4345
"src/app/SharpRaven/SharpRaven.csproj",
4446
"src/app/SharpRaven.Nancy/SharpRaven.Nancy.csproj",
4547
};
48+
var branchName = gitVersion.BranchName.Trim();
4649

4750
//////////////////////////////////////////////////////////////////////
4851
// SETUP
4952
//////////////////////////////////////////////////////////////////////
5053

5154
Setup(context =>
5255
{
56+
Information("Building version {0} ({1}@{2}) of SharpRaven.",
57+
version, branchName, tag);
58+
5359
if (isAppVeyor)
5460
{
61+
// If AppVeyor is building master with no tag, it should
62+
// not update the build version, since it will be duplicate
63+
// with the one for the tagged build
64+
if (branchName == "master" && !isTaggedBuild)
65+
{
66+
return;
67+
}
68+
5569
AppVeyor.UpdateBuildVersion(gitVersion.FullBuildMetaData);
5670
}
57-
58-
Information("Building version {0} of RavenSharp.", version);
5971
});
6072

6173
//////////////////////////////////////////////////////////////////////
@@ -193,19 +205,7 @@ Task("UploadAppVeyorArtifacts")
193205
Task("PublishNuGetPackages")
194206
.Description("Publishes .nupkg files to nuget.org")
195207
.IsDependentOn("Package")
196-
.WithCriteria(() =>
197-
{
198-
if (!isAppVeyor)
199-
{
200-
return false;
201-
}
202-
203-
var branchName = gitVersion.BranchName.Trim();
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";
208-
})
208+
.WithCriteria(isAppVeyor && (isTaggedBuild || branchName == "develop"))
209209
.Does(() =>
210210
{
211211
if (String.IsNullOrEmpty(nugetOrgApiKey))

0 commit comments

Comments
 (0)