Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 38 additions & 9 deletions build/build/Tasks/Package/PackageChocolatey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,50 @@ public override void Run(BuildContext context)
{
context.EnsureDirectoryExists(Paths.Nuget);

var portableNuspecFile = Paths.Nuspec.CombineWithFilePath("GitVersion.Portable.nuspec");
if (!context.FileExists(portableNuspecFile))
return;

var artifactPath = context.MakeAbsolute(Paths.ArtifactsBinPortable).FullPath;

var portableSettings = GetChocolateyPackSettings(context, "GitVersion.Portable");
portableSettings.Files = context.GetFiles(artifactPath + "/**/*.*")
.Select(file => new ChocolateyNuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") })
.ToArray();

context.ChocolateyPack(portableSettings);

var metaPackageSettings = GetChocolateyPackSettings(context, "GitVersion");
metaPackageSettings.Files = context.GetFiles(artifactPath + "/**/*.txt")
.Select(file => new ChocolateyNuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") })
.ToArray();

metaPackageSettings.Dependencies = new[]
{
new ChocolateyNuSpecDependency { Id = "GitVersion.Portable", Version = context.Version?.ChocolateyVersion }
};

context.ChocolateyPack(metaPackageSettings);
}

private static ChocolateyPackSettings GetChocolateyPackSettings(BuildContextBase context, string id)
{
var chocolateySettings = new ChocolateyPackSettings
{
LimitOutput = true,
Id = id,
Version = context.Version?.ChocolateyVersion,
Title = "GitVersion",
Description = "Derives SemVer information from a repository following GitFlow or GitHubFlow.",
Authors = new[] { "GitTools and Contributors" },
Owners = new[] { "GitTools and Contributors" },
Copyright = $"Copyright GitTools {DateTime.Now.Year}",
DocsUrl = new Uri("https://gitversion.net/docs/"),
LicenseUrl = new Uri("https://opensource.org/license/mit/"),
ProjectUrl = new Uri("https://github.com/GitTools/GitVersion"),
ProjectSourceUrl = new Uri("https://github.com/GitTools/GitVersion"),
IconUrl = new Uri("https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/Color/icon_100x100.png"),
RequireLicenseAcceptance = false,
Tags = new[] { "Git", "Versioning", "GitVersion", "GitFlowVersion", "GitFlow", "GitHubFlow", "SemVer" },
ReleaseNotes = new[] { $"https://github.com/GitTools/GitVersion/releases/tag/{context.Version?.ChocolateyVersion}" },
OutputDirectory = Paths.Nuget,
Files = context.GetFiles(artifactPath + "/**/*.*")
.Select(file => new ChocolateyNuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") })
.ToArray()
LimitOutput = true,
};
context.ChocolateyPack(portableNuspecFile, chocolateySettings);
return chocolateySettings;
}
}
18 changes: 0 additions & 18 deletions build/nuspec/GitVersion.Portable.nuspec

This file was deleted.

1 change: 0 additions & 1 deletion build/nuspec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ works out the [Semantic Version][semver] of the commit being built.
| Artifact | Stable | |
| :------------------------- | :----------------------------------------------------------------- | - |
| **GitVersion.Tool** | [![NuGet][gvgt-badge]][gvgt] |
| **GitVersion.CommandLine** | [![NuGet][gvcl-badge]][gvcl] |
| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | Known as [GitVersionTask][gitversiontask] before v5.6.0 |

## Compatibility
Expand Down
2 changes: 1 addition & 1 deletion build/nuspec/VERIFICATION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ in verifying that this package's contents are trustworthy.

This package is published by the GitTools organization itself. The binaries are
identical to other package types published by the project, in particular
the GitVersion.Portable nuget package.
the GitVersion.Portable and GitVersion nuget package.
4 changes: 3 additions & 1 deletion build/publish/BuildLifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public override void Setup(BuildContext context, ISetupContext info)
foreach (var packageFile in nugetPackagesFiles)
{
var packageName = packageFile.GetFilenameWithoutExtension().ToString()[..^(nugetVersion.Length + 1)].ToLower();
context.Packages.Add(new NugetPackage(packageName, packageFile, packageName.Contains("Portable", StringComparison.OrdinalIgnoreCase)));
var isChocoPackage = packageName.Equals("GitVersion.Portable", StringComparison.OrdinalIgnoreCase) ||
packageName.Equals("GitVersion", StringComparison.OrdinalIgnoreCase);
context.Packages.Add(new NugetPackage(packageName, packageFile, isChocoPackage));
}
}
context.StartGroup("Build Setup");
Expand Down