Skip to content

Commit

Permalink
Merge pull request #770 from unoplatform/mergify/bp/release/stable/5.…
Browse files Browse the repository at this point in the history
…3/pr-766

Private feed Fix (backport #766)
  • Loading branch information
jeromelaban authored Jun 21, 2024
2 parents 33c04b0 + a36e5f8 commit 58248f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
14 changes: 8 additions & 6 deletions tools/Uno.Sdk.Updater/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.IO.Compression;
using System.IO.Compression;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
Expand Down Expand Up @@ -38,6 +38,7 @@
}

var unoVersion = versions.OrderByDescending(x => x).First();
client.UnoVersion = unoVersion;

Console.WriteLine($"Found Uno Version: {unoVersion}");
Console.WriteLine($"Downloading {UnoSdkPackageId}");
Expand Down Expand Up @@ -268,11 +269,12 @@ static async Task<ManifestGroup> 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;
Expand Down
10 changes: 8 additions & 2 deletions tools/Uno.Sdk.Updater/Services/NuGetClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ internal class NuGetApiClient : IDisposable
BaseAddress = new Uri("https://pkgs.dev.azure.com")
};

public NuGetVersion? UnoVersion { get; set; }

public async Task<Stream> 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";
Expand All @@ -36,9 +38,13 @@ public async Task<IEnumerable<NuGetVersion>> GetPackageVersions(string packageId
{
var allVersions = new List<string>();
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<NuGetVersion>();
foreach (var version in allVersions.Distinct())
Expand Down

0 comments on commit 58248f8

Please sign in to comment.