Skip to content

Commit 87c04fc

Browse files
committed
Update package dependencies and simplify versioning
This commit updates the versions for CodecovUploaderCmd and gitreleasemanager.tool in the respective configuration files. A simplification was also made in the BuildVersion record in Models.cs to remove Chocolatey-specific versioning. The dependencies in PackageChocolatey.cs have been adjusted to use NugetVersion instead of ChocolateyVersion.
1 parent 968333d commit 87c04fc

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

build/build/Tasks/Package/PackageChocolatey.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override void Run(BuildContext context)
3737

3838
metaPackageSettings.Dependencies = new[]
3939
{
40-
new ChocolateyNuSpecDependency { Id = "GitVersion.Portable", Version = context.Version?.ChocolateyVersion }
40+
new ChocolateyNuSpecDependency { Id = "GitVersion.Portable", Version = context.Version?.NugetVersion }
4141
};
4242

4343
context.ChocolateyPack(metaPackageSettings);
@@ -48,7 +48,7 @@ private static ChocolateyPackSettings GetChocolateyPackSettings(BuildContextBase
4848
var chocolateySettings = new ChocolateyPackSettings
4949
{
5050
Id = id,
51-
Version = context.Version?.ChocolateyVersion,
51+
Version = context.Version?.NugetVersion,
5252
Title = "GitVersion",
5353
Description = "Derives SemVer information from a repository following GitFlow or GitHubFlow.",
5454
Authors = new[] { "GitTools and Contributors" },
@@ -61,7 +61,7 @@ private static ChocolateyPackSettings GetChocolateyPackSettings(BuildContextBase
6161
IconUrl = new Uri("https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/Color/icon_100x100.png"),
6262
RequireLicenseAcceptance = false,
6363
Tags = new[] { "Git", "Versioning", "GitVersion", "GitFlowVersion", "GitFlow", "GitHubFlow", "SemVer" },
64-
ReleaseNotes = new[] { $"https://github.com/GitTools/GitVersion/releases/tag/{context.Version?.ChocolateyVersion}" },
64+
ReleaseNotes = new[] { $"https://github.com/GitTools/GitVersion/releases/tag/{context.Version?.NugetVersion}" },
6565
OutputDirectory = Paths.Nuget,
6666
LimitOutput = true,
6767
};

build/common/Utilities/Models.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,17 @@ public record DockerHubCredentials(string Username, string Password);
1515

1616
public record ChocolateyCredentials(string ApiKey);
1717

18-
public record BuildVersion(GitVersion GitVersion, string? Version, string? Milestone, string? SemVersion, string? NugetVersion, string? ChocolateyVersion, bool IsPreRelease)
18+
public record BuildVersion(GitVersion GitVersion, string? Version, string? Milestone, string? SemVersion, string? NugetVersion, bool IsPreRelease)
1919
{
2020
public static BuildVersion Calculate(GitVersion gitVersion)
2121
{
2222
var version = gitVersion.MajorMinorPatch;
2323
var semVersion = gitVersion.SemVer;
2424
var nugetVersion = gitVersion.SemVer;
25-
var chocolateyVersion = gitVersion.MajorMinorPatch;
26-
27-
if (!string.IsNullOrWhiteSpace(gitVersion.PreReleaseTag))
28-
{
29-
// Chocolatey does not support pre-release tags with dots, so we replace them with dashes
30-
// if the pre-release tag is a number, we add a "a" prefix to the pre-release tag
31-
// the trick should be removed when Chocolatey supports semver 2.0
32-
var prefix = int.TryParse(gitVersion.PreReleaseLabel, out _) ? "a" : string.Empty;
33-
chocolateyVersion += $"-{prefix}{gitVersion.PreReleaseTag?.Replace(".", "-")}";
34-
}
3525

3626
if (!string.IsNullOrWhiteSpace(gitVersion.BuildMetaData))
3727
{
3828
semVersion += $"-{gitVersion.BuildMetaData}";
39-
chocolateyVersion += $"-{gitVersion.BuildMetaData}";
4029
nugetVersion += $".{gitVersion.BuildMetaData}";
4130
}
4231

@@ -46,7 +35,6 @@ public static BuildVersion Calculate(GitVersion gitVersion)
4635
Milestone: semVersion,
4736
SemVersion: semVersion,
4837
NugetVersion: nugetVersion?.ToLowerInvariant(),
49-
ChocolateyVersion: chocolateyVersion?.ToLowerInvariant(),
5038
IsPreRelease: !gitVersion.PreReleaseLabel.IsNullOrEmpty()
5139
);
5240
}

build/common/Utilities/Tools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ public class Tools
66

77
public static readonly Dictionary<string, string> Versions = new()
88
{
9-
{ CodecovUploaderCmd, "0.3.2" },
9+
{ CodecovUploaderCmd, "0.7.1" },
1010
};
1111
}

dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"gitreleasemanager.tool": {
6-
"version": "0.13.0",
6+
"version": "0.15.0",
77
"commands": [
88
"dotnet-gitreleasemanager"
99
]

0 commit comments

Comments
 (0)