|
4 | 4 | using System.Linq;
|
5 | 5 | using System.Runtime.InteropServices;
|
6 | 6 | using System.Threading.Tasks;
|
7 |
| - |
8 | 7 | using Nuke.Common;
|
9 | 8 | using Nuke.Common.Execution;
|
10 | 9 | using Nuke.Common.IO;
|
@@ -378,7 +377,7 @@ Dictionary<string, object> ProcessedMsbuildProperties
|
378 | 377 | Logger.Warn("Skipping gradlew build as the \"native\" feature-set has not been specified.");
|
379 | 378 | return Enumerable.Empty<Output>();
|
380 | 379 | }
|
381 |
| - |
| 380 | + |
382 | 381 | var sdl = RootDirectory / "build" / "submodules" / "SDL";
|
383 | 382 | var silkDroid = SourceDirectory / "Windowing" / "Android" / "SilkDroid";
|
384 | 383 | var xcopy = new (string, string)[]
|
@@ -525,31 +524,51 @@ async Task<IEnumerable<Output>> PushPackages()
|
525 | 524 | await Task.Delay(TimeSpan.FromHours(1));
|
526 | 525 | }
|
527 | 526 |
|
528 |
| - var srcSettings = new DotNetNuGetAddSourceSettings().SetName("Silk-PushPackages").SetSource(NugetFeed); |
529 |
| - if (NugetUsername is not null || NugetPassword is not null) |
| 527 | + if (!NugetFeed.Contains("nuget.org")) |
530 | 528 | {
|
531 |
| - if (NugetUsername is null || NugetPassword is null) |
| 529 | + var srcSettings = new DotNetNuGetAddSourceSettings().SetName("Silk-PushPackages").SetSource(NugetFeed); |
| 530 | + |
| 531 | + if (NugetUsername is not null || NugetPassword is not null) |
532 | 532 | {
|
533 |
| - ControlFlow.Fail |
534 |
| - ( |
535 |
| - "Both \"NugetUsername\" and \"NugetPassword\" must be specified if either are used." |
536 |
| - ); |
| 533 | + if (NugetUsername is null || NugetPassword is null) |
| 534 | + { |
| 535 | + ControlFlow.Fail |
| 536 | + ( |
| 537 | + "Both \"NugetUsername\" and \"NugetPassword\" must be specified if either are used." |
| 538 | + ); |
| 539 | + } |
| 540 | + |
| 541 | + srcSettings = srcSettings.SetUsername(NugetUsername).SetPassword(NugetPassword); |
537 | 542 | }
|
538 | 543 |
|
539 |
| - srcSettings = srcSettings.SetUsername(NugetUsername).SetPassword(NugetPassword); |
| 544 | + outputs = outputs.Concat(DotNetNuGetAddSource(srcSettings)); |
540 | 545 | }
|
541 |
| - |
542 |
| - outputs = outputs.Concat(DotNetNuGetAddSource(srcSettings)); |
543 | 546 |
|
544 |
| - foreach (var pushSettings in files.Select(file => new DotNetNuGetPushSettings() |
545 |
| - .SetNoServiceEndpoint(NugetNoServiceEndpoint) |
546 |
| - .EnableSkipDuplicate() |
547 |
| - .SetTargetPath(file))) |
| 547 | + foreach (var pushSettings in files.Select |
| 548 | + ( |
| 549 | + file => |
| 550 | + { |
| 551 | + var x = new DotNetNuGetPushSettings() |
| 552 | + .SetNoServiceEndpoint(NugetNoServiceEndpoint) |
| 553 | + .EnableSkipDuplicate() |
| 554 | + .SetSource(NugetFeed.Contains("nuget.org") ? "nuget.org" : "Silk-PushPackages") |
| 555 | + .SetTargetPath(file); |
| 556 | + if (NugetApiKey is not null) |
| 557 | + { |
| 558 | + x = x.SetApiKey(NugetApiKey); |
| 559 | + } |
| 560 | + |
| 561 | + return x; |
| 562 | + } |
| 563 | + )) |
548 | 564 | {
|
549 | 565 | outputs = outputs.Concat(DotNetNuGetPush(pushSettings));
|
550 | 566 | }
|
551 | 567 |
|
552 |
| - outputs = outputs.Concat(DotNet($"dotnet nuget remove source \"Silk-PushPackages\"")); |
| 568 | + if (!NugetFeed.Contains("nuget.org")) |
| 569 | + { |
| 570 | + outputs = outputs.Concat(DotNet($"dotnet nuget remove source \"Silk-PushPackages\"")); |
| 571 | + } |
553 | 572 | }
|
554 | 573 |
|
555 | 574 | return outputs;
|
|
0 commit comments