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
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsExecutableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override void Run(BuildContext context)
{
var packagesToTest = new[]
{
"GitVersion.Commandline", "GitVersion.Portable"
"GitVersion.Portable"
};
foreach (var packageToTest in packagesToTest)
{
Expand Down
31 changes: 0 additions & 31 deletions build/build/Tasks/Package/PackageNuget.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Cake.Common.Tools.DotNet.Pack;
using Cake.Common.Tools.NuGet.Pack;
using Common.Utilities;

namespace Build.Tasks;
Expand All @@ -14,7 +13,6 @@ public override void Run(BuildContext context)
context.EnsureDirectoryExists(Paths.Nuget);

PackageWithCli(context);
PackageUsingNuspec(context);
}
private static void PackageWithCli(BuildContext context)
{
Expand All @@ -34,33 +32,4 @@ private static void PackageWithCli(BuildContext context)
settings.ArgumentCustomization = arg => arg.Append("/p:IsPackaging=true");
context.DotNetPack("./src/GitVersion.MsBuild", settings);
}
private static void PackageUsingNuspec(BuildContextBase context)
{
var cmdlineNuspecFile = Paths.Nuspec.CombineWithFilePath("GitVersion.CommandLine.nuspec");
if (!context.FileExists(cmdlineNuspecFile))
return;

var artifactPath = context.MakeAbsolute(Paths.ArtifactsBinCmdline).FullPath;
var version = context.Version;
var gitVersion = version?.GitVersion;
var nugetSettings = new NuGetPackSettings
{
// KeepTemporaryNuSpecFile = true,
Version = version?.NugetVersion,
NoPackageAnalysis = true,
OutputDirectory = Paths.Nuget,
Repository = new NuGetRepository
{
Branch = gitVersion?.BranchName,
Commit = gitVersion?.Sha
},
Files = context.GetFiles(artifactPath + "/**/*.*")
.Select(file => new NuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") })
.Concat(context.GetFiles("docs/**/package_icon.png").Select(file => new NuSpecContent { Source = file.FullPath, Target = "package_icon.png" }))
.Concat(context.GetFiles("build/nuspec/README.md").Select(file => new NuSpecContent { Source = file.FullPath, Target = "README.md" }))
.ToArray()
};

context.NuGetPack(cmdlineNuspecFile, nugetSettings);
}
}
5 changes: 0 additions & 5 deletions build/build/Tasks/Package/PackagePrepare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ public override void Run(BuildContext context)
var sourceDir = Paths.Native.Combine(PlatformFamily.Windows.ToString()).Combine("win-x64");
var sourceFiles = context.GetFiles(sourceDir + "/*.*");

var cmdlineDir = Paths.ArtifactsBinCmdline.Combine("tools");

context.EnsureDirectoryExists(cmdlineDir);
context.CopyFiles(sourceFiles, cmdlineDir);

var portableDir = Paths.ArtifactsBinPortable.Combine("tools");
context.EnsureDirectoryExists(portableDir);

Expand Down
21 changes: 0 additions & 21 deletions build/nuspec/GitVersion.CommandLine.nuspec

This file was deleted.

2 changes: 1 addition & 1 deletion build/publish/Tasks/PublishNuget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public override bool ShouldRun(BuildContext context)
public override void Run(BuildContext context)
{
// publish to github packages for commits on main and on original repo
if (context.IsGitHubActionsBuild && context.IsOnMainOrSupportBranchOriginalRepo)
if (context is { IsGitHubActionsBuild: true, IsOnMainOrSupportBranchOriginalRepo: true })
{
var apiKey = context.Credentials?.GitHub?.Token;
if (string.IsNullOrEmpty(apiKey))
Expand Down