Skip to content

Commit

Permalink
Merge pull request #17348 from abpframework/auto-merge/rel-7-3/2116
Browse files Browse the repository at this point in the history
Merge branch dev with rel-7.3
  • Loading branch information
EngincanV authored Aug 10, 2023
2 parents e2070e7 + f56fd11 commit 525ab12
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,20 @@ private async Task<string> UpdateVoloPackagesAsync(string content,
{
if ((includeNightlyPreviews || (currentVersion.Contains("-preview") && !switchToStable)) && !includeReleaseCandidates)
{
var latestVersion = latestMyGetVersion == null || isLeptonXPackage ?
await GetLatestVersionFromMyGet(packageId) : latestMyGetVersion;
string latestVersion;
if(isLeptonXPackage)
{
latestVersion = (await _packageVersionCheckerService.GetLatestVersionOrNullAsync(packageId, includeNightlyPreviews, includeReleaseCandidates))?.Version?.ToString();
}
else
{
latestVersion = latestMyGetVersion == null ? await GetLatestVersionFromMyGet(packageId) : latestMyGetVersion;
}

if(latestVersion == null && isLeptonXPackage) //leptonx-pro package
if(latestVersion == null)
{
latestVersion = await GetLatestVersionFromMyGet("Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme", isNightly: includeNightlyPreviews);
Logger.LogWarning("Package: {0} could not be updated. Please manually update the package version yourself to prevent version mismatches.", packageId);
continue;
}

if (currentVersion != latestVersion)
Expand Down Expand Up @@ -288,10 +296,10 @@ private async Task<string> UpdateVoloPackagesAsync(string content,
return await Task.FromResult(content);
}

private async Task<string> GetLatestVersionFromMyGet(string packageId, bool isNightly = false)
private async Task<string> GetLatestVersionFromMyGet(string packageId)
{
var myGetPack = await _myGetPackageListFinder.GetPackagesAsync();

return myGetPack.Packages.FirstOrDefault(p => p.Id == packageId)?.Versions.LastOrDefault(x => isNightly ? x.Contains("-preview") : true);
return myGetPack.Packages.FirstOrDefault(p => p.Id == packageId)?.Versions.LastOrDefault();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,11 @@ public async Task<LatestVersionInfo> GetLatestVersionOrNullAsync(string packageI
return null;
}

List<SemanticVersion> versions;

if (!includeNightly && includeReleaseCandidates)
{
versions = versionList
.Where(v => !v.Contains("-preview"))
.Select(SemanticVersion.Parse)
.OrderByDescending(v => v, new VersionComparer()).ToList();
}
else
{
versions = versionList
.Select(SemanticVersion.Parse)
.OrderByDescending(v => v, new VersionComparer()).ToList();
}
List<SemanticVersion> versions = versionList
.WhereIf(!includeNightly, v => !v.Contains("-preview"))
.WhereIf(!includeReleaseCandidates, v => !v.Contains("rc"))
.Select(SemanticVersion.Parse)
.OrderByDescending(v => v, new VersionComparer()).ToList();

return versions.Any()
? new LatestVersionInfo(versions.Max())
Expand Down

0 comments on commit 525ab12

Please sign in to comment.