Skip to content

Commit d6020e9

Browse files
authored
Restrict what's published to AppVeyor NuGet feed (BDN nightly) (#2047)
- Fixes cake build regression introduced by switching from the old cake script https://github.com/dotnet/BenchmarkDotNet/blob/a936815f2a58d9b728cfc5fe620bba17481c180c/build.cake#L151-L153 - and additionally excludes any builds triggered from commits to non-master branches. The Cake Pack task is executed only if the build: - runs on AppVeyor - is not a PR - is triggered from 'master' branch - runs on Windows Reason: On AppVeyor, the packages produced by Pack are automatically uploaded as artifacts AND to the AppVeyor NuGet feed. On GitHub and Azure Pipelines, Pack output is discarded anyway. Fixes #1937.
1 parent 461b709 commit d6020e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build/Program.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public class BuildContext : FrostingContext
5858

5959
private IAppVeyorProvider AppVeyor => this.BuildSystem().AppVeyor;
6060
public bool IsOnAppVeyorAndNotPr => AppVeyor.IsRunningOnAppVeyor && !AppVeyor.Environment.PullRequest.IsPullRequest;
61+
public bool IsOnAppVeyorAndBdnNightlyCiCd => IsOnAppVeyorAndNotPr && AppVeyor.Environment.Repository.Branch == "master" && this.IsRunningOnWindows();
6162
public bool IsLocalBuild => this.BuildSystem().IsLocalBuild;
6263
public bool IsCiBuild => !this.BuildSystem().IsLocalBuild;
6364

@@ -360,6 +361,11 @@ public class AllTestsTask : FrostingTask<BuildContext>
360361
[IsDependentOn(typeof(BuildTask))]
361362
public class PackTask : FrostingTask<BuildContext>
362363
{
364+
public override bool ShouldRun(BuildContext context)
365+
{
366+
return context.IsOnAppVeyorAndBdnNightlyCiCd;
367+
}
368+
363369
public override void Run(BuildContext context)
364370
{
365371
var settingsSrc = new DotNetCorePackSettings

0 commit comments

Comments
 (0)