Skip to content

Commit 701532b

Browse files
Merge pull request #11 from TimeWarpEngineering/Cramer/2025-12-22/dev
fix: implement NuGet push in CI release pipeline
2 parents 31ac8b0 + 4e85301 commit 701532b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tools/dev-cli/endpoints/ci-command.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,22 @@ private async Task RunReleaseWorkflowAsync(string repoRoot, string? apiKey, Canc
195195
if (!string.IsNullOrEmpty(apiKey))
196196
{
197197
Terminal.WriteLine("\nPushing packages to NuGet...");
198-
Terminal.WriteLine(" (Push not yet implemented - manual push required)");
198+
string[] packages = Directory.GetFiles(artifactsDir, "*.nupkg");
199+
foreach (string package in packages)
200+
{
201+
string packageName = Path.GetFileName(package);
202+
Terminal.WriteLine($" Pushing {packageName}...");
203+
204+
exitCode = await DotNet.NuGet()
205+
.Push(package)
206+
.WithSource("https://api.nuget.org/v3/index.json")
207+
.WithApiKey(apiKey)
208+
.RunAsync(ct);
209+
210+
if (exitCode != 0) throw new InvalidOperationException($"NuGet push failed: {packageName}");
211+
}
212+
213+
Terminal.WriteLine("✓ Packages pushed to NuGet.org");
199214
}
200215
}
201216
}

0 commit comments

Comments
 (0)