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

Version 1.9.0 #78

Merged
merged 44 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4a5ada4
Add `AzureSignToolUtils` and `build` with `.props` and `.targets`
ricaun Dec 6, 2024
7e3e758
Update `Tests`
ricaun Dec 6, 2024
cef6ce4
Change `Tools` namespace
ricaun Dec 6, 2024
281e1a7
Add `PackageDownload` to download tools on the fly.
ricaun Dec 6, 2024
fd3fabb
Update PackageDownload to check if tools exists.
ricaun Dec 6, 2024
4f157d2
Update `PackageDownload`
ricaun Dec 6, 2024
b2033b2
Force to Download Package
ricaun Dec 7, 2024
6d8c490
Use `Requires`
ricaun Dec 10, 2024
4677cbf
Add `HttpAuthTasks` to get/post files
ricaun Dec 11, 2024
adc41a1
Remove `Requires`
ricaun Dec 12, 2024
435563b
Update `IsPathTooLong`
ricaun Dec 12, 2024
52f074a
Remove `CreateTemporaryIgnore`
ricaun Dec 12, 2024
72ead81
Update `HttpAuthTasks` docs
ricaun Dec 12, 2024
2cf5916
Update `SignExtension.Sign` to sign NuGet or files.
ricaun Dec 12, 2024
bbb17f2
Update `SignProject` to sign files using `Azure Key Vault` if available
ricaun Dec 12, 2024
9c9ed33
Add `build` with `.targets`
ricaun Dec 12, 2024
a04fe48
Add import `build` with `.targets`
ricaun Dec 12, 2024
01cfe84
Version `1.9.0-alpha.11`
ricaun Dec 12, 2024
188ca30
Update `AzureSignToolUtils` to not download packages
ricaun Dec 12, 2024
70f72f8
Add `Directory.Build.props`
ricaun Dec 12, 2024
3f69d43
Update `HttpAuthTasks`
ricaun Dec 12, 2024
9cd908f
Add version `Information` in the `CommonExtension`.
ricaun Dec 17, 2024
d9c5724
Add `PackageDownload` to download
ricaun Dec 17, 2024
54286ca
Update `GetToolInstallationPath` to use user temp folder
ricaun Dec 17, 2024
b1bf8d1
Update `TestRunUtil` icons to circle with color
ricaun Dec 17, 2024
a9c0897
Add `Resource` and `Resource.pt-BR` to test sign files.
ricaun Dec 17, 2024
45c94a4
Update `AzureSignToolUtils` sign to ignore exception
ricaun Dec 17, 2024
7e3f4d6
Update `Build.yml`
ricaun Dec 17, 2024
5ca5e2b
Use Azure
ricaun Dec 17, 2024
9cccfbd
Update `AzureSignToolUtils` to ignore if file is already signed.
ricaun Dec 17, 2024
f9f79a7
Update readme
ricaun Dec 17, 2024
657fd0f
Update readme
ricaun Dec 17, 2024
f3f4431
Update `HasSignature` to use `PathTooLongUtils`
ricaun Dec 17, 2024
0ff874f
Version beta.5
ricaun Dec 17, 2024
087ceeb
Remove `target` and `Require`
ricaun Dec 17, 2024
43c3f10
Enable `IAssetRelease` to release assets before `GitRelease` and `Git…
ricaun Dec 18, 2024
b9814b7
Add `ILocalAssetRelease` to test `AssetRelease`
ricaun Dec 18, 2024
a395540
Update `ci`
ricaun Dec 18, 2024
8c36f4c
Enable `SkipForked`
ricaun Dec 18, 2024
0b5729b
Fix `SkipForked`
ricaun Dec 18, 2024
130ecc9
Invert `SkipForked`
ricaun Dec 18, 2024
8790658
Update `IsForked`
ricaun Dec 18, 2024
9c45e79
Update `ExecuteReleaseAsset` to execute `IHazAssetRelease` and build …
ricaun Dec 18, 2024
186a0b6
Version 1.9.0
ricaun Dec 19, 2024
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
17 changes: 9 additions & 8 deletions .github/workflows/Develop.yml → .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# ------------------------------------------------------------------------------
# Develop.yml
# Build.yml
# ------------------------------------------------------------------------------

name: Develop
name: Build

on:
push:
branches-ignore:
- master
pull_request:
branches-ignore:
- master
- main
workflow_dispatch:

jobs:
Develop:
name: Develop
Build:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
Expand All @@ -28,5 +27,7 @@ jobs:
NugetApiUrl: ${{ secrets.NUGET_API_URL }}
NugetApiKey: ${{ secrets.NUGET_API_KEY }}

SignFile: ${{ secrets.SIGN_FILE }}
SignPassword: ${{ secrets.SIGN_PASSWORD }}
# SignFile: ${{ secrets.SIGN_FILE }}
# SignPassword: ${{ secrets.SIGN_PASSWORD }}
SignFile: ${{ secrets.SIGN_FILE_AZURE }}
SignPassword: ${{ secrets.SIGN_PASSWORD_AZURE }}
29 changes: 0 additions & 29 deletions .github/workflows/Publish.yml

This file was deleted.

1 change: 1 addition & 0 deletions Build/.nuke/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
temp
5 changes: 5 additions & 0 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
"ExecutableTarget": {
"type": "string",
"enum": [
"AzureSignTool",
"Build",
"Clean",
"Compile",
"CompileExample",
"GitPreRelease",
"GitRelease",
"LocalAssetRelease",
"Pack",
"PrePack",
"Release",
Expand Down Expand Up @@ -109,6 +111,9 @@
"allOf": [
{
"properties": {
"EnableForkedRepository": {
"type": "boolean"
},
"Folder": {
"type": "string"
},
Expand Down
4 changes: 3 additions & 1 deletion Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
using ricaun.Nuke;
using ricaun.Nuke.Components;

class Build : NukeBuild, IPublishPack, ICompileExample, ITest, IShowGitVersion, IPrePack
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;
public static int Main() => Execute<Build>(x => x.From<IPublishPack>().Build);
Expand Down
1 change: 1 addition & 0 deletions Build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
<ItemGroup>
<ProjectReference Include="..\ricaun.Nuke\ricaun.Nuke.csproj" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions Build/IAzureSignTool.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Nuke.Common;
using Nuke.Common.Tools.AzureSignTool;
using ricaun.Nuke.Components;
using ricaun.Nuke.Tools.NuGetKeyVaultSignTool;

public interface IAzureSignTool : IClean, ICompile
{
Target AzureSignTool => _ => _
.TriggeredBy(Clean)
.Before(Compile)
.Executes(() =>
{
ricaun.Nuke.Tools.AzureSignToolUtils.EnsureAzureToolIsInstalled();

Serilog.Log.Information(AzureSignToolTasks.AzureSignToolPath);
Serilog.Log.Information(NuGetKeyVaultSignToolTasks.NuGetKeyVaultSignToolPath);
});
}
35 changes: 35 additions & 0 deletions Build/ILocalAssetRelease.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Nuke.Common;
using ricaun.Nuke.Components;
using ricaun.Nuke.Extensions;

class AssetRelease : IAssetRelease
{
public void ReleaseAsset(ReleaseAssets releaseAssets)
{
Serilog.Log.Information($"Project: {releaseAssets.Project.Name}");
Serilog.Log.Information($"Version: {releaseAssets.Version}");
Serilog.Log.Information($"Notes: {releaseAssets.Notes}");
Serilog.Log.Information($"Prerelease: {releaseAssets.Prerelease}");
foreach (var file in releaseAssets.Assets)
{
Serilog.Log.Information($"File: {file}");
}
}
}

public interface ILocalAssetRelease : IClean, ICompile, IHazAssetRelease, IAssetRelease
{
Target LocalAssetRelease => _ => _
.TriggeredBy(Clean)
.Before(Compile)
.Executes(() =>
{
var releaseAssets = new ReleaseAssets
{
Project = MainProject,
Version = "0.0.0",
Notes = "Release Notes",
};
ExecuteReleaseAsset(releaseAssets);
});
}
21 changes: 20 additions & 1 deletion Build/IShowGitVersion.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Nuke.Common;
using Nuke.Common.Git;
using ricaun.Nuke.Components;
using ricaun.Nuke.Extensions;

public interface IShowGitVersion : IHazGitVersion, IHazChangelog, IClean, ICompile
public interface IShowGitVersion : IHazGitVersion, IHazGitRepository, IHazChangelog, IClean, ICompile
{
Target ShowGitVersion => _ => _
.TriggeredBy(Clean)
Expand All @@ -23,5 +24,23 @@ public interface IShowGitVersion : IHazGitVersion, IHazChangelog, IClean, ICompi
System.IO.Path.Combine(BuildAssemblyDirectory, $"latest.json"));
}
catch { }


Serilog.Log.Information("Commit = {Value}", GitRepository.Commit);
Serilog.Log.Information("Branch = {Value}", GitRepository.Branch);
Serilog.Log.Information("Tags = {Value}", GitRepository.Tags);
Serilog.Log.Information("Head = {Value}", GitRepository.Head);
Serilog.Log.Information("Identifier = {Value}", GitRepository.Identifier);

Serilog.Log.Information("IsForked = {Value}", GitRepository.IsForked());

Serilog.Log.Information("main branch = {Value}", GitRepository.IsOnMainBranch());
Serilog.Log.Information("main/master branch = {Value}", GitRepository.IsOnMainOrMasterBranch());
Serilog.Log.Information("release/* branch = {Value}", GitRepository.IsOnReleaseBranch());
Serilog.Log.Information("hotfix/* branch = {Value}", GitRepository.IsOnHotfixBranch());

Serilog.Log.Information("Https URL = {Value}", GitRepository.HttpsUrl);
Serilog.Log.Information("SSH URL = {Value}", GitRepository.SshUrl);

});
}
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,39 @@ 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.9.0] / 2024-12-06 - 2024-12-19
### Features
- Enable sign files using `Azure Key Vault`.
- Enable `IAssetRelease` to release assets before `GitRelease` and `GitPreRelease`.
- Enable `SkipForked` to skip release if forked repository.
### Build
- Add `IAzureSignTool` to check if `AzureSignToolUtils` is installed.
- Add `ILocalAssetRelease` to test `AssetRelease` assets before release.
### Updates
- Add version `Information` in the `CommonExtension`.
- Add `AzureSignToolUtils` to sign files using `AzureSignToolTasks` or `NuGetKeyVaultSignToolTasks`.
- Add `NuGetKeyVaultSignTool` for nuke version `8.*`.
- Add `AzureKeyVaultConfig` with json file with `Azure Key Vault` without secrets.
- Add `PackageDownload` to download `AzureSignTool` and `NuGetKeyVaultSignTool` on the fly.
- Add `HttpAuthTasks` to get/post files.
- Update `HttpAuthTasks` docs.
- Update `IsPathTooLong` to equal or greater than `260`.
- Update `SignExtension.Sign` to sign NuGet or files.
- Update `SignProject` to sign files using `Azure Key Vault` if available.
- Update `GetToolInstallationPath` to use user temp folder.
- Update `TestRunUtil` icons to circle with color.
- 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
- Update `NuGetExtensionTests`
- Add `AzureKeyVaultConfigTests`

## [1.8.2] / 2024-11-20
### Update
### Updates
- Update `Nuke.Common` to `8.1.4`.
- Update `FileSystemTasks.CopyFileToDirectory` to `AbsolutePathExtensions.CopyToDirectory`.
- Update `FileSystemTasks.CopyDirectoryRecursively` to `AbsolutePathExtensions.Copy`.
Expand Down Expand Up @@ -358,6 +389,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[1.9.0]: ../../compare/1.8.2...1.9.0
[1.8.2]: ../../compare/1.8.1...1.8.2
[1.8.1]: ../../compare/1.8.0...1.8.1
[1.8.0]: ../../compare/1.7.4...1.8.0
Expand Down
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.9.0</Version>
</PropertyGroup>
</Project>
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This package is to simplify the build automation system using [Nuke.Common](http
[![Visual Studio 2022](https://img.shields.io/badge/Visual%20Studio-2022-blue)](../..)
[![Nuke](https://img.shields.io/badge/Nuke-Build-blue)](https://nuke.build/)
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Publish](https://github.com/ricaun-io/ricaun.Nuke/actions/workflows/Publish.yml/badge.svg)](https://github.com/ricaun-io/ricaun.Nuke/actions)
[![Build](https://github.com/ricaun-io/ricaun.Nuke/actions/workflows/Build.yml/badge.svg)](https://github.com/ricaun-io/ricaun.Nuke/actions)
[![Release](https://img.shields.io/nuget/v/ricaun.Nuke?logo=nuget&label=release&color=blue)](https://www.nuget.org/packages/ricaun.Nuke)

# Examples
Expand Down Expand Up @@ -51,7 +51,14 @@ class Build : NukeBuild, IPublishPack

## Environment Variables

### Publish Package Github
### Publish Github

```yml
env:
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
```

### SignFile and SignPassword

```yml
env:
Expand All @@ -60,6 +67,41 @@ env:
SignPassword: ${{ secrets.SIGN_PASSWORD }}
```

`SignFile` could be a `file/url/Base64` to the certificate file.
`SignPassword` is the password to the certificate file.

#### SignFile using `Azure Key Vault`

To simplify the configuration to sign with `Azure Key Vault` using the same environment variables are used `SignFile` and `SignPassword`.

```yml
env:
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
SignFile: ${{ secrets.SIGN_FILE_AZURE }}
SignPassword: ${{ secrets.SIGN_PASSWORD_AZURE }}
```

##### SIGN_FILE_AZURE

The `SIGN_FILE_AZURE` is a `json` with the base configuration of the certificated in the `Azure Key Vault`:

```json
{
"AzureKeyVaultCertificate": "AzureKeyVaultCertificate",
"AzureKeyVaultUrl": "AzureKeyVaultUrl",
"AzureKeyVaultClientId": "AzureKeyVaultClientId",
"AzureKeyVaultTenantId": "AzureKeyVaultTenantId",
"TimestampUrl" : "http://timestamp.digicert.com"
"TimestampDigest" : "sha256"
}
```

The `TimestampUrl` and `TimestampDigest` are optional.

##### SIGN_PASSWORD_AZURE

The `SIGN_PASSWORD_AZURE` is the `AzureKeyVaultClientSecret` of the `Azure Key Vault` certificate.

### Publish Package Nuget

```yml
Expand Down
2 changes: 1 addition & 1 deletion ricaun.Nuke.Example.Tests/ricaun.Nuke.Example.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading
Loading