From 14e6fa6b0e45ee3385f8d518ed8a4065fbf5b32d Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Wed, 1 Oct 2025 18:23:55 -0400 Subject: [PATCH 1/3] chore(nuget): clarify publish behavior reentrant --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ef055b58..b1e1f611 100644 --- a/README.md +++ b/README.md @@ -753,7 +753,8 @@ targets: ### NuGet (`nuget`) Uploads packages to [NuGet](https://www.nuget.org/) via [.NET Core](https://github.com/dotnet/core). -By default, `craft` publishes all packages with `.nupkg` extension. +By default, `craft` publishes all packages with `.nupkg` extension by using `dotnet nuget publish --skip-duplicate` +so re-running `craft` means it will not fail, but instead continue to publish any package it failed. **Environment** From 77386cc639a1087219aef396d74a421cd8e13ee8 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 2 Oct 2025 14:55:50 -0400 Subject: [PATCH 2/3] Update README.md Co-authored-by: Burak Yigit Kaya --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b1e1f611..37d777df 100644 --- a/README.md +++ b/README.md @@ -753,8 +753,7 @@ targets: ### NuGet (`nuget`) Uploads packages to [NuGet](https://www.nuget.org/) via [.NET Core](https://github.com/dotnet/core). -By default, `craft` publishes all packages with `.nupkg` extension by using `dotnet nuget publish --skip-duplicate` -so re-running `craft` means it will not fail, but instead continue to publish any package it failed. +Normally, `craft` targets raise an exception when trying to release a version that already exists. *This target diverges from the norm and allows re-entrant publishing* as it can publish multiple packages at once and the processes might get interrupted. This behavior allows us to finalize half-finished releases without having to publish a new version and play cat & mouse with the flaky upstream package repository. **Environment** From 4bb04e0dc09861f8446bc9d891af3764c0da5f45 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Mon, 6 Oct 2025 22:30:54 +0100 Subject: [PATCH 3/3] add code comment --- src/targets/nuget.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/targets/nuget.ts b/src/targets/nuget.ts index 36c568e6..f61dead9 100644 --- a/src/targets/nuget.ts +++ b/src/targets/nuget.ts @@ -79,6 +79,11 @@ export class NugetTarget extends BaseTarget { '--api-key', '${NUGET_API_TOKEN}', '--source', + // Warning: `--skip-duplicate` means we will NOT error when a version + // already exists. This is unlike any other target in Craft but + // became needed here as NuGet repo is quite flaky and we need to + // publish many packages at once without another way to resume a + // broken release. '--skip-duplicate', this.nugetConfig.serverUrl, ];