Skip to content

Commit ccf4852

Browse files
fix(publish): add --skip-duplicate so nuget push is idempotent (#108)
Without --skip-duplicate, a single failed push aborts the whole publish target, and a rerun then fails with HTTP 409 ("already exists") on every package that did succeed the first time. That makes release.yml non-recoverable from any partial-failure state, which we hit twice today (#107 → SolutionPersistence prefix-reservation, then again mid-key-permission-debug). With --skip-duplicate, the push step returns success when a version is already on nuget.org. Reruns are now safe and only the genuinely missing packages get uploaded. Wired via IPublish.PushSettings override (Configure<DotNetNuGetPushSettings>), which composes on top of the existing PushSettingsBase in Fallout.Components. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6c26e76 commit ccf4852

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

build/Build.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ IEnumerable<AbsolutePath> IPublish.PushPackageFiles
142142
=> From<IPack>().PackagesDirectory.GlobFiles("*.nupkg")
143143
.Where(x => !x.NameWithoutExtension.StartsWith("Nuke.", StringComparison.OrdinalIgnoreCase));
144144

145+
// `--skip-duplicate` makes nuget push idempotent: if a version is already on the feed,
146+
// skip it instead of erroring. Lets us rerun release.yml safely when a single package
147+
// fails mid-batch without nuking the whole pipeline on retry.
148+
Configure<DotNetNuGetPushSettings> IPublish.PushSettings => _ => _
149+
.EnableSkipDuplicate();
150+
145151
IEnumerable<AbsolutePath> NuGetPackageFiles
146152
=> From<IPack>().PackagesDirectory.GlobFiles("*.nupkg");
147153

0 commit comments

Comments
 (0)