Skip to content

Commit b4cf5a3

Browse files
ci: remove --skip-duplicate from nuget push (fail loudly on duplicate)
If an earlier workflow run already uploaded a broken nupkg for the same version (as happened on 0.1.5 where a pre-fix run pushed x64-only compile-time refs), --skip-duplicate silently no-ops the corrected push and leaves the broken package on nuget.org. Better to fail loudly so we notice and bump the version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 59bc922 commit b4cf5a3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,14 @@ jobs:
136136
$ErrorActionPreference = 'Stop'
137137
$key = "${{ secrets.NUGET_API_KEY }}"
138138
if (-not $key) { throw "NUGET_API_KEY secret is not set." }
139+
# NOTE: --skip-duplicate intentionally NOT used. If a previous run
140+
# already pushed this version (e.g. from an earlier failed attempt
141+
# before a fix landed), we want this push to FAIL LOUDLY so we
142+
# know to bump the version. Silent skip + uploaded "good" artifact
143+
# caused 0.1.5 to ship with stale (x64-only) compile-time refs.
139144
Get-ChildItem artifacts\*.nupkg | ForEach-Object {
140145
dotnet nuget push $_.FullName `
141146
--api-key $key `
142-
--source https://api.nuget.org/v3/index.json `
143-
--skip-duplicate
147+
--source https://api.nuget.org/v3/index.json
144148
if ($LASTEXITCODE -ne 0) { throw "Push failed for $($_.Name)" }
145149
}

0 commit comments

Comments
 (0)