diff --git a/tools/Uno.Sdk.Updater/Program.cs b/tools/Uno.Sdk.Updater/Program.cs index 3058d58d..93127ad7 100644 --- a/tools/Uno.Sdk.Updater/Program.cs +++ b/tools/Uno.Sdk.Updater/Program.cs @@ -1,4 +1,4 @@ -using System.IO.Compression; +using System.IO.Compression; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; @@ -38,6 +38,7 @@ } var unoVersion = versions.OrderByDescending(x => x).First(); +client.UnoVersion = unoVersion; Console.WriteLine($"Found Uno Version: {unoVersion}"); Console.WriteLine($"Downloading {UnoSdkPackageId}"); @@ -268,11 +269,12 @@ static async Task UpdateGroup(ManifestGroup group, NuGetVersion u var preview = unoVersion.IsPreview; string[] stableOnlyGroups = [ - "CoreLogging", - "OSLogging", - "UniversalImageLoading", - "WasmBootstrap" -]; + "CoreLogging", + "OSLogging", + "UniversalImageLoading", + "WasmBootstrap" + ]; + if (stableOnlyGroups.Any(x => x == group.Group)) { preview = false; diff --git a/tools/Uno.Sdk.Updater/Services/NuGetClient.cs b/tools/Uno.Sdk.Updater/Services/NuGetClient.cs index 279e3980..08469c9b 100644 --- a/tools/Uno.Sdk.Updater/Services/NuGetClient.cs +++ b/tools/Uno.Sdk.Updater/Services/NuGetClient.cs @@ -15,6 +15,8 @@ internal class NuGetApiClient : IDisposable BaseAddress = new Uri("https://pkgs.dev.azure.com") }; + public NuGetVersion? UnoVersion { get; set; } + public async Task DownloadPackageAsync(string packageId, string version) { var downloadUrl = $"/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_apis/packaging/feeds/e7ce08df-613a-41a3-8449-d42784dd45ce/nuget/packages/{packageId}/versions/{version}/content"; @@ -36,9 +38,13 @@ public async Task> GetPackageVersions(string packageId { var allVersions = new List(); var publicVersions = await GetPublicPackageVersions(packageId); - var privateVersions = await GetPrivatePackageVersions(packageId); allVersions.AddRange(publicVersions); - allVersions.AddRange(privateVersions); + + if (!UnoVersion.HasValue || !UnoVersion.Value.IsPreview) + { + var privateVersions = await GetPrivatePackageVersions(packageId); + allVersions.AddRange(privateVersions); + } var output = new List(); foreach (var version in allVersions.Distinct())