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 #228 from getsentry/feature/appveyor-fixes
Browse files Browse the repository at this point in the history
Various fixes that should stop untagged `master` builds to fail on AppVeyor.
  • Loading branch information
asbjornu authored Mar 11, 2018
2 parents 3ed4b3b + 7de41fa commit 0e651f7
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
#tool "nuget:?package=GitVersion.CommandLine"

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
// ARGUMENTS AND ENVIRONMENT VARIABLES
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Debug");
var nugetOrgApiKey = EnvironmentVariable("NuGetOrgApiKey");
var isTaggedBuild = Convert.ToBoolean(EnvironmentVariable("APPVEYOR_REPO_TAG"));
var tag = EnvironmentVariable("APPVEYOR_REPO_TAG_NAME") ?? "<no tag>";

var isAppVeyor = BuildSystem.IsRunningOnAppVeyor;
var isTravis = BuildSystem.IsRunningOnTravisCI;
Expand Down Expand Up @@ -43,19 +45,29 @@ var packages = new []
"src/app/SharpRaven/SharpRaven.csproj",
"src/app/SharpRaven.Nancy/SharpRaven.Nancy.csproj",
};
var branchName = gitVersion.BranchName.Trim();

//////////////////////////////////////////////////////////////////////
// SETUP
//////////////////////////////////////////////////////////////////////

Setup(context =>
{
Information("Building version {0} ({1}@{2}) of SharpRaven.",
version, branchName, tag);
if (isAppVeyor)
{
// If AppVeyor is building master with no tag, it should
// not update the build version, since it will be duplicate
// with the one for the tagged build
if (branchName == "master" && !isTaggedBuild)
{
return;
}
AppVeyor.UpdateBuildVersion(gitVersion.FullBuildMetaData);
}
Information("Building version {0} of RavenSharp.", version);
});

//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -193,19 +205,7 @@ Task("UploadAppVeyorArtifacts")
Task("PublishNuGetPackages")
.Description("Publishes .nupkg files to nuget.org")
.IsDependentOn("Package")
.WithCriteria(() =>
{
if (!isAppVeyor)
{
return false;
}
var branchName = gitVersion.BranchName.Trim();
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";
})
.WithCriteria(isAppVeyor && (isTaggedBuild || branchName == "develop"))
.Does(() =>
{
if (String.IsNullOrEmpty(nugetOrgApiKey))
Expand Down

0 comments on commit 0e651f7

Please sign in to comment.