Skip to content

Commit c86c6f8

Browse files
Merge pull request #401 from nvisionative/develop
Merged `develop` into `main` for `2.5.0` release
2 parents ad88489 + 6d12e71 commit c86c6f8

File tree

7 files changed

+836
-783
lines changed

7 files changed

+836
-783
lines changed

nvQuickSite/Controllers/PackageController.cs

+23-3
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ public static IEnumerable<Package> GetPackageList()
103103
}
104104
}
105105

106+
// Remove RCs if they already have a non-RC version.
107+
packages.RemoveAll(p =>
108+
p.did == "dnn-platform-rc" &&
109+
packages.Any(p2 =>
110+
p2.version.Major == p.version.Major &&
111+
p2.version.Minor == p2.version.Minor &&
112+
p2.version.Build == p2.version.Build &&
113+
p2.did != "dnn-platform-rc"));
114+
106115
SaveLocalPackagesFile(packages);
107116
Log.Logger.Information("Saved local packages file");
108117
Log.Logger.Debug("Saved packages to local packages file: {@packages}", packages);
@@ -201,15 +210,26 @@ private static IEnumerable<Package> GetGitHubPackages()
201210

202211
ghPackage.version = new System.Version(release.TagName.TrimStart('v').Split('-')[0]);
203212

204-
if (index == 0 &&
205-
release.Name.IndexOf("rc", StringComparison.OrdinalIgnoreCase) >= 0 &&
213+
if (release.Name.IndexOf("rc", StringComparison.OrdinalIgnoreCase) >= 0 &&
206214
Properties.Settings.Default.ShowReleaseCandidates &&
207215
installPackage != null)
208216
{
209217
ghPackage.did = "dnn-platform-rc";
210-
ghPackage.name = "DNN Platform Release Candidate " + release.TagName.Split('-')[1].ToUpperInvariant().Substring(2);
218+
ghPackage.name = "DNN Platform Release Candidate";
211219
ghPackage.url = installPackage.BrowserDownloadUrl;
212220
ghPackage.upgradeurl = upgradePackage.BrowserDownloadUrl;
221+
222+
var preReleaseTag = release.TagName.TrimStart('v').Split('-')[1];
223+
var rcSuffix = preReleaseTag.Replace("rc", string.Empty);
224+
if (int.TryParse(rcSuffix, out int preReleaseNumber))
225+
{
226+
ghPackage.version = new System.Version(
227+
ghPackage.version.Major,
228+
ghPackage.version.Minor,
229+
ghPackage.version.Build,
230+
preReleaseNumber);
231+
}
232+
213233
packages.Add(ghPackage);
214234
}
215235
else if (!release.Name.ToUpperInvariant().Contains("RC") &&
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace nvQuickSite.Extensions
2+
{
3+
using System;
4+
5+
/// <summary>
6+
/// Extension methods for <see cref="Version"/> objects.
7+
/// </summary>
8+
public static class VersionExtensions
9+
{
10+
/// <summary>
11+
/// Converts a DotNet Version into a semantic version string.
12+
/// </summary>
13+
/// <param name="version">The version to convert.</param>
14+
/// <returns>9.13.8 or 10.0.0-rc1 for example.</returns>
15+
public static string ToSemanticString(this Version version)
16+
{
17+
var baseVersion = version.ToString(3);
18+
if (version.Revision > 0)
19+
{
20+
return $"{baseVersion}-rc{version.Revision}";
21+
}
22+
23+
return baseVersion;
24+
}
25+
}
26+
}

nvQuickSite/Models/Package.cs

+22-19
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1-
// Copyright (c) 2016-2020 nvisionative, Inc.
2-
//
3-
// This file is part of nvQuickSite.
4-
//
5-
// nvQuickSite is free software: you can redistribute it and/or modify
6-
// it under the terms of the GNU General Public License as published by
7-
// the Free Software Foundation, either version 3 of the License, or
8-
// (at your option) any later version.
9-
//
10-
// nvQuickSite is distributed in the hope that it will be useful,
11-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
13-
// GNU General Public License for more details.
14-
//
15-
// You should have received a copy of the GNU General Public License
16-
// along with nvQuickSite. If not, see <http://www.gnu.org/licenses/>.
17-
1+
// Copyright (c) 2016-2020 nvisionative, Inc.
2+
//
3+
// This file is part of nvQuickSite.
4+
//
5+
// nvQuickSite is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// nvQuickSite is distributed in the hope that it will be useful,
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
13+
// GNU General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU General Public License
16+
// along with nvQuickSite. If not, see <http://www.gnu.org/licenses/>.
17+
1818
namespace nvQuickSite.Models
1919
{
20+
using System.Diagnostics;
21+
2022
using Newtonsoft.Json;
21-
using Newtonsoft.Json.Converters;
22-
23+
using Newtonsoft.Json.Converters;
24+
2325
/// <summary>
2426
/// Represents one package.
2527
/// </summary>
28+
[DebuggerDisplay("{did} {version}")]
2629
public class Package
2730
{
2831
/// <summary>

nvQuickSite/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
// You can specify all the values or you can default the Build and Revision Numbers
5050
// by using the '*' as shown below:
5151
// [assembly: AssemblyVersion("1.0.*")]
52-
[assembly: AssemblyVersion("2.4.0")]
53-
[assembly: AssemblyFileVersion("2.4.0")]
52+
[assembly: AssemblyVersion("2.5.0")]
53+
[assembly: AssemblyFileVersion("2.5.0")]
5454
[assembly: NeutralResourcesLanguage("en")]

0 commit comments

Comments
 (0)