Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.7.3 #69

Merged
merged 3 commits into from
Dec 22, 2023
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
3 changes: 3 additions & 0 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@
"TestResults": {
"type": "boolean"
},
"UnlistNuget": {
"type": "boolean"
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
Expand Down
1 change: 1 addition & 0 deletions Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class Build : NukeBuild, IPublishPack, ICompileExample, ITest, IShowGitVersion, IPrePack
{
bool IPack.UnlistNuget => true;
bool ITest.TestBuildStopWhenFailed => false;
public static int Main() => Execute<Build>(x => x.From<IPublishPack>().Build);
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.7.3] / 2023-12-18
### Features
- `IPack` with `UnlistNuget` to unlist nuget package.

## [1.7.2] / 2023-10-05 - 2023-11-18
### Features
- Enable `SignBinary` with `PathTooLong` path.
Expand Down Expand Up @@ -327,6 +331,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[1.7.3]: ../../compare/1.7.2...1.7.3
[1.7.2]: ../../compare/1.7.1...1.7.2
[1.7.1]: ../../compare/1.7.0...1.7.1
[1.7.0]: ../../compare/1.6.1...1.7.0
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ using ricaun.Nuke.Components;

class Build : NukeBuild, IPublish
{
// string IHazMainProject.MainName => "ProjectName";
public static int Main() => Execute<Build>(x => x.From<IPublish>().Build);
}
```
Expand All @@ -43,6 +44,7 @@ using ricaun.Nuke.Components;

class Build : NukeBuild, IPublishPack
{
// string IHazMainProject.MainName => "ProjectName";
public static int Main() => Execute<Build>(x => x.From<IPublishPack>().Build);
}
```
Expand Down
11 changes: 11 additions & 0 deletions ricaun.Nuke/Components/IHazPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ void DotNetNuGetPush(AbsolutePath packageFilePath)
NuGetExtension.DotNetNuGetPush(NugetApiUrl, NugetApiKey, packageFilePath);
}

/// <summary>
/// DotNetNuGetPrerelease
/// </summary>
/// <param name="packageFilePath"></param>
void DotNetNuGetPrerelease(AbsolutePath packageFilePath)
{
var packageNameVersion = packageFilePath.Name;
NuGetExtension.DotNetNuGetPush(NugetApiUrl, NugetApiKey, packageFilePath);
NuGetExtension.NuGetUnlist(NugetApiUrl, NugetApiKey, packageNameVersion);
}

/// <summary>
/// IsPrePackFile
/// </summary>
Expand Down
18 changes: 16 additions & 2 deletions ricaun.Nuke/Components/IPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ namespace ricaun.Nuke.Components
/// </summary>
public interface IPack : IHazPack, IGitRelease
{
/// <summary>
/// UnlistNuget (Default: false)
/// </summary>
/// <remarks>This feature only works on 'api.nuget.org' to unlist package.</remarks>
[Parameter]
bool UnlistNuget => TryGetValue<bool?>(() => UnlistNuget) ?? false;

/// <summary>
/// Target Pack
/// </summary>
Expand All @@ -25,8 +32,15 @@ public interface IPack : IHazPack, IGitRelease
.Executes(() =>
{
var releaseDirectory = GetReleaseDirectory(MainProject);
Globbing.GlobFiles(releaseDirectory, "**/*.nupkg")
.ForEach(DotNetNuGetPush);
var packages = Globbing.GlobFiles(releaseDirectory, "**/*.nupkg");

if (UnlistNuget)
{
packages.ForEach(DotNetNuGetPrerelease);
return;
}

packages.ForEach(DotNetNuGetPush);
});
}
}
11 changes: 0 additions & 11 deletions ricaun.Nuke/Components/IPrePack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,5 @@ public interface IPrePack : IPack, IGitPreRelease

prerelease.ForEach(DotNetNuGetPrerelease);
});

/// <summary>
/// DotNetNuGetPrerelease
/// </summary>
/// <param name="packageFilePath"></param>
public void DotNetNuGetPrerelease(AbsolutePath packageFilePath)
{
var packageNameVersion = packageFilePath.Name;
NuGetExtension.DotNetNuGetPush(NugetApiUrl, NugetApiKey, packageFilePath);
NuGetExtension.NuGetUnlist(NugetApiUrl, NugetApiKey, packageNameVersion);
}
}
}
2 changes: 1 addition & 1 deletion ricaun.Nuke/ricaun.Nuke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<PackageId>ricaun.Nuke</PackageId>
<Version>1.7.2</Version>
<Version>1.7.3</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
Loading