Skip to content

Commit

Permalink
Merge pull request #782 from AdmiringWorm/nuget-duplicate
Browse files Browse the repository at this point in the history
(GH-775) Add ability to skip duplicate package version during push
  • Loading branch information
gep13 authored Feb 23, 2021
2 parents 1e7d418 + 019708a commit 6276e7b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cake.Recipe/Content/packages.cake
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ public void PushNuGetPackages(ICakeContext context, bool isRelease, List<Package

var nugetPushSettings = new NuGetPushSettings
{
Source = nugetSource.PushUrl
Source = nugetSource.PushUrl,
SkipDuplicate = ToolSettings.SkipDuplicatePackages
};

var canPushToNuGetSource = false;
Expand Down
4 changes: 3 additions & 1 deletion Cake.Recipe/Content/toolsettings.cake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static class ToolSettings
public static MSBuildToolVersion BuildMSBuildToolVersion { get; private set; }
public static int MaxCpuCount { get; private set; }
public static string TargetFrameworkPathOverride { get; private set; }
public static bool SkipDuplicatePackages { get; private set; }

public static string CodecovTool { get; private set; }
public static string CoverallsTool { get; private set; }
Expand Down Expand Up @@ -99,7 +100,8 @@ public static class ToolSettings
DirectoryPath targetFrameworkPathOverride = null,
string[] dupFinderExcludeFilesByStartingCommentSubstring = null,
int? dupFinderDiscardCost = null,
bool? dupFinderThrowExceptionOnFindingDuplicates = null
bool? dupFinderThrowExceptionOnFindingDuplicates = null,
bool skipDuplicatePackages = false
)
{
context.Information("Setting up tools...");
Expand Down
8 changes: 8 additions & 0 deletions docs/input/docs/fundamentals/set-tool-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,11 @@ This is used when executing the DupFinder command line tool. If set to true, an
Type: `bool?`

Default Value: `null`

### skipDuplicatesPackages

This is used to tell NuGet to ignore issues with trying to push package versions when the version already exist upstream, instead of failing the build.

Type: `bool`

Default Value: `false`

0 comments on commit 6276e7b

Please sign in to comment.