Skip to content

Commit 2186106

Browse files
committed
This is the November 2021 Update (v2.10.0) (#671)
* Packaging improvements, NuGet readmes, and 2.10 release notes * Fix GitHub README rendering issues * Attempt to fix whitespace * push push push push push push push * Actually fix whitespace * Update common.props * Update Directory.Build.props
1 parent 886c6b2 commit 2186106

File tree

1 file changed

+36
-17
lines changed
  • src/infrastructure/Silk.NET.NUKE

1 file changed

+36
-17
lines changed

src/infrastructure/Silk.NET.NUKE/Build.cs

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Linq;
55
using System.Runtime.InteropServices;
66
using System.Threading.Tasks;
7-
87
using Nuke.Common;
98
using Nuke.Common.Execution;
109
using Nuke.Common.IO;
@@ -378,7 +377,7 @@ Dictionary<string, object> ProcessedMsbuildProperties
378377
Logger.Warn("Skipping gradlew build as the \"native\" feature-set has not been specified.");
379378
return Enumerable.Empty<Output>();
380379
}
381-
380+
382381
var sdl = RootDirectory / "build" / "submodules" / "SDL";
383382
var silkDroid = SourceDirectory / "Windowing" / "Android" / "SilkDroid";
384383
var xcopy = new (string, string)[]
@@ -525,31 +524,51 @@ async Task<IEnumerable<Output>> PushPackages()
525524
await Task.Delay(TimeSpan.FromHours(1));
526525
}
527526

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"))
530528
{
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)
532532
{
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);
537542
}
538543

539-
srcSettings = srcSettings.SetUsername(NugetUsername).SetPassword(NugetPassword);
544+
outputs = outputs.Concat(DotNetNuGetAddSource(srcSettings));
540545
}
541-
542-
outputs = outputs.Concat(DotNetNuGetAddSource(srcSettings));
543546

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+
))
548564
{
549565
outputs = outputs.Concat(DotNetNuGetPush(pushSettings));
550566
}
551567

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+
}
553572
}
554573

555574
return outputs;

0 commit comments

Comments
 (0)