Skip to content

Commit 5776829

Browse files
mishamyteclaude
andcommitted
ci: fix NuGet push arguments and stop rebuilding in the publish job
dotnet nuget push is not an MSBuild command and has no --verbosity option - DotNet.exec's Verbosity setting appended one and the first 9.0.0 publish attempt died on argument parsing before any upload. Drop it, add --skip-duplicate so re-runs of a failed release are idempotent, and report the exit code on failure (stderr was empty). The publish job also re-ran the entire FAKE chain (restore, build, 121 tests x 3 TFMs, pack). It now downloads the nupkg the build job already produced and tested in the same run and only pushes it (--single-target skips the dependency chain), so we ship the exact verified bits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a89c0e2 commit 5776829

2 files changed

Lines changed: 18 additions & 13 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,21 @@ jobs:
102102
timeout-minutes: 15
103103
steps:
104104
- uses: actions/checkout@v6
105-
with:
106-
fetch-depth: 0
107105

108106
- name: Setup .NET
109107
uses: actions/setup-dotnet@v5.3.0
110108
with:
111109
dotnet-version: 10.x
112110

113-
- name: Pack & Push
114-
run: dotnet fsi build.fsx -- --target Push
111+
# Push the exact bits the build job produced and tested in this run —
112+
# no rebuild, no re-test (--single-target skips the FAKE dependency chain).
113+
- name: Download packed artifact
114+
uses: actions/download-artifact@v8
115+
with:
116+
name: nuget-ubuntu-latest
117+
path: artifacts
118+
119+
- name: Push
120+
run: dotnet fsi build.fsx -- --target Push --single-target
115121
env:
116122
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

build.fsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,16 @@ Target.create "Push" (fun _ ->
112112

113113
!! $"{Artifacts}/*.nupkg"
114114
|> Seq.iter (fun pkg ->
115-
let result =
116-
DotNet.exec
117-
(fun o ->
118-
{ o with
119-
Verbosity = Some DotNet.Verbosity.Minimal
120-
})
121-
"nuget"
122-
$"push \"{pkg}\" -s https://api.nuget.org/v3/index.json -k {key}"
115+
// No DotNet.exec Verbosity here: `dotnet nuget push` is not an MSBuild command and
116+
// has no --verbosity option — passing one fails argument parsing before any upload.
117+
// --skip-duplicate makes re-runs of a (partially) failed release idempotent.
118+
let args =
119+
$"push \"{pkg}\" -s https://api.nuget.org/v3/index.json -k {key} --skip-duplicate"
120+
121+
let result = DotNet.exec id "nuget" args
123122

124123
if not result.OK then
125-
failwithf $"nuget push failed: %A{result.Errors}"))
124+
failwithf $"nuget push failed for %s{pkg} with exit code %d{result.ExitCode}"))
126125

127126
// Run the BenchmarkDotNet suites (V9 + V8 + YetAnother). Standalone — deliberately NOT in
128127
// the Default chain (slow, and pulls the V8 NuGet closure). Cross-platform via dotnet fsi:

0 commit comments

Comments
 (0)