Skip to content

Commit 6b8a4ca

Browse files
authored
Merge pull request #3376 from arturcic/feature/3375
#3375 - stop publishing the GitVersion.Commandline nuget package
2 parents 48ccca9 + 028552c commit 6b8a4ca

File tree

5 files changed

+2
-59
lines changed

5 files changed

+2
-59
lines changed

build/artifacts/Tasks/ArtifactsExecutableTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public override void Run(BuildContext context)
2020
{
2121
var packagesToTest = new[]
2222
{
23-
"GitVersion.Commandline", "GitVersion.Portable"
23+
"GitVersion.Portable"
2424
};
2525
foreach (var packageToTest in packagesToTest)
2626
{
Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Cake.Common.Tools.DotNet.Pack;
2-
using Cake.Common.Tools.NuGet.Pack;
32
using Common.Utilities;
43

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

1615
PackageWithCli(context);
17-
PackageUsingNuspec(context);
1816
}
1917
private static void PackageWithCli(BuildContext context)
2018
{
@@ -34,33 +32,4 @@ private static void PackageWithCli(BuildContext context)
3432
settings.ArgumentCustomization = arg => arg.Append("/p:IsPackaging=true");
3533
context.DotNetPack("./src/GitVersion.MsBuild", settings);
3634
}
37-
private static void PackageUsingNuspec(BuildContextBase context)
38-
{
39-
var cmdlineNuspecFile = Paths.Nuspec.CombineWithFilePath("GitVersion.CommandLine.nuspec");
40-
if (!context.FileExists(cmdlineNuspecFile))
41-
return;
42-
43-
var artifactPath = context.MakeAbsolute(Paths.ArtifactsBinCmdline).FullPath;
44-
var version = context.Version;
45-
var gitVersion = version?.GitVersion;
46-
var nugetSettings = new NuGetPackSettings
47-
{
48-
// KeepTemporaryNuSpecFile = true,
49-
Version = version?.NugetVersion,
50-
NoPackageAnalysis = true,
51-
OutputDirectory = Paths.Nuget,
52-
Repository = new NuGetRepository
53-
{
54-
Branch = gitVersion?.BranchName,
55-
Commit = gitVersion?.Sha
56-
},
57-
Files = context.GetFiles(artifactPath + "/**/*.*")
58-
.Select(file => new NuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") })
59-
.Concat(context.GetFiles("docs/**/package_icon.png").Select(file => new NuSpecContent { Source = file.FullPath, Target = "package_icon.png" }))
60-
.Concat(context.GetFiles("build/nuspec/README.md").Select(file => new NuSpecContent { Source = file.FullPath, Target = "README.md" }))
61-
.ToArray()
62-
};
63-
64-
context.NuGetPack(cmdlineNuspecFile, nugetSettings);
65-
}
6635
}

build/build/Tasks/Package/PackagePrepare.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ public override void Run(BuildContext context)
1515
var sourceDir = Paths.Native.Combine(PlatformFamily.Windows.ToString()).Combine("win-x64");
1616
var sourceFiles = context.GetFiles(sourceDir + "/*.*");
1717

18-
var cmdlineDir = Paths.ArtifactsBinCmdline.Combine("tools");
19-
20-
context.EnsureDirectoryExists(cmdlineDir);
21-
context.CopyFiles(sourceFiles, cmdlineDir);
22-
2318
var portableDir = Paths.ArtifactsBinPortable.Combine("tools");
2419
context.EnsureDirectoryExists(portableDir);
2520

build/nuspec/GitVersion.CommandLine.nuspec

Lines changed: 0 additions & 21 deletions
This file was deleted.

build/publish/Tasks/PublishNuget.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override bool ShouldRun(BuildContext context)
2626
public override void Run(BuildContext context)
2727
{
2828
// publish to github packages for commits on main and on original repo
29-
if (context.IsGitHubActionsBuild && context.IsOnMainOrSupportBranchOriginalRepo)
29+
if (context is { IsGitHubActionsBuild: true, IsOnMainOrSupportBranchOriginalRepo: true })
3030
{
3131
var apiKey = context.Credentials?.GitHub?.Token;
3232
if (string.IsNullOrEmpty(apiKey))

0 commit comments

Comments
 (0)