Skip to content

Commit

Permalink
Update ExecuteReleaseAsset to execute IHazAssetRelease and build …
Browse files Browse the repository at this point in the history
…with `IAssetRelease`
  • Loading branch information
ricaun committed Dec 18, 2024
1 parent 8790658 commit 9c45e79
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
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, IAzureSignTool, IPrePack, ILocalAssetRelease
{
public void ReleaseAsset(ReleaseAssets releaseAssets) { }
IAssetRelease IHazAssetRelease.AssetRelease => new AssetRelease();
//bool IPack.UnlistNuget => true;
bool ITest.TestBuildStopWhenFailed => false;
Expand Down
4 changes: 2 additions & 2 deletions Build/ILocalAssetRelease.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void ReleaseAsset(ReleaseAssets releaseAssets)
}
}

public interface ILocalAssetRelease : IClean, ICompile, IHazAssetRelease
public interface ILocalAssetRelease : IClean, ICompile, IHazAssetRelease, IAssetRelease
{
Target LocalAssetRelease => _ => _
.TriggeredBy(Clean)
Expand All @@ -30,6 +30,6 @@ public interface ILocalAssetRelease : IClean, ICompile, IHazAssetRelease
Version = "0.0.0",
Notes = "Release Notes",
};
ReleaseAsset(releaseAssets);
ExecuteReleaseAsset(releaseAssets);
});
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Update `AzureSignToolUtils` sign to ignore exception.
- Update `AzureSignToolUtils` to ignore if file is already signed.
- Update `HasSignature` to use `PathTooLongUtils` to check if file is signed. (Fix: #77)
- Update `ExecuteReleaseAsset` to execute `IHazAssetRelease` and build with `IAssetRelease`
### Example
- Add `Resource` and `Resource.pt-BR` to test sign files.
### Tests
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.9.0-rc.1</Version>
<Version>1.9.0-rc.2</Version>
</PropertyGroup>
</Project>
7 changes: 6 additions & 1 deletion ricaun.Nuke/Components/IAssetRelease.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,18 @@ public interface IHazAssetRelease
/// Releases the specified assets.
/// </summary>
/// <param name="releaseAssets">The assets to be released.</param>
public void ReleaseAsset(ReleaseAssets releaseAssets)
public void ExecuteReleaseAsset(ReleaseAssets releaseAssets)
{
if (AssetRelease is IAssetRelease assetRelease)
{
Serilog.Log.Information($"ReleaseAsset: {assetRelease}");
assetRelease.ReleaseAsset(releaseAssets);
}
if (this is IAssetRelease buildAssetRelease)
{
Serilog.Log.Information($"ReleaseAsset: {buildAssetRelease}");
buildAssetRelease.ReleaseAsset(releaseAssets);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion ricaun.Nuke/Components/IGitRelease.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void ReleaseGitHubProject(Project project, bool releaseAsPrerelease = false)
Prerelease = releaseAsPrerelease
};

ReleaseAsset(releaseAssets);
ExecuteReleaseAsset(releaseAssets);

var newRelease = new Octokit.NewRelease(version)
{
Expand Down

0 comments on commit 9c45e79

Please sign in to comment.