-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable
IAssetRelease
to release assets before GitRelease
and `Git…
…PreRelease`
- Loading branch information
Showing
6 changed files
with
111 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Version>1.9.0-beta.6</Version> | ||
<Version>1.9.0-beta.7</Version> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using Nuke.Common.IO; | ||
using Nuke.Common.ProjectModel; | ||
using ricaun.Nuke.IO; | ||
using System.Collections.Generic; | ||
|
||
namespace ricaun.Nuke.Components | ||
{ | ||
/// <summary> | ||
/// Represents the assets to be released. | ||
/// </summary> | ||
public class ReleaseAssets | ||
{ | ||
/// <summary> | ||
/// Gets the project associated with the release. | ||
/// </summary> | ||
public Project Project { get; init; } | ||
|
||
/// <summary> | ||
/// Gets the version of the release. | ||
/// </summary> | ||
public string Version { get; init; } | ||
|
||
/// <summary> | ||
/// Gets the release notes. | ||
/// </summary> | ||
public string Notes { get; init; } | ||
|
||
/// <summary> | ||
/// Gets the collection of zip files to be released. | ||
/// </summary> | ||
public IReadOnlyCollection<AbsolutePath> Files { get; init; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether the release is a prerelease. | ||
/// </summary> | ||
public bool Prerelease { get; init; } = false; | ||
} | ||
/// <summary> | ||
/// Defines a component that has asset release capabilities | ||
/// </summary> | ||
/// <remarks><see cref="IHazAssetRelease.AssetRelease"/> executes inside <see cref="IGitPreRelease"/> and <see cref="IGitRelease"/> before release.</remarks> | ||
public interface IHazAssetRelease | ||
{ | ||
/// <summary> | ||
/// Gets the asset release instance. | ||
/// </summary> | ||
IAssetRelease AssetRelease => null; | ||
|
||
/// <summary> | ||
/// Releases the specified assets. | ||
/// </summary> | ||
/// <param name="releaseAssets">The assets to be released.</param> | ||
public void ReleaseAsset(ReleaseAssets releaseAssets) | ||
{ | ||
if (AssetRelease is IAssetRelease assetRelease) | ||
{ | ||
Serilog.Log.Information($"Asset Release {assetRelease}"); | ||
assetRelease.ReleaseAsset(releaseAssets); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Defines the interface for releasing assets. | ||
/// </summary> | ||
public interface IAssetRelease | ||
{ | ||
/// <summary> | ||
/// Releases the specified assets. | ||
/// </summary> | ||
/// <param name="releaseAssets">The assets to be released.</param> | ||
/// <remarks>Use <see cref="HttpAuthTasks"/> to post/put the release files in a private server.</remarks> | ||
public void ReleaseAsset(ReleaseAssets releaseAssets); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters