NukeBuildHelpers 7.0.4

This package has a SemVer 2.0.0 package version: 7.0.4+build.540.
dotnet add package NukeBuildHelpers --version 7.0.4                
NuGet\Install-Package NukeBuildHelpers -Version 7.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NukeBuildHelpers" Version="7.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NukeBuildHelpers --version 7.0.4                
#r "nuget: NukeBuildHelpers, 7.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NukeBuildHelpers as a Cake Addin
#addin nuget:?package=NukeBuildHelpers&version=7.0.4

// Install NukeBuildHelpers as a Cake Tool
#tool nuget:?package=NukeBuildHelpers&version=7.0.4                

NukeBuildHelpers

NukeBuildHelpers is a C# project build automation tool built on top of NukeBuild. It supports both GitHub Actions and Azure Pipelines for CI/CD, enabling release management across multiple projects and environments within a single repository.

NuGet

Name Info
NukeBuildHelpers NuGet

Features

  • Multi-project and Multi-environment Support: Handle releases for multiple projects and environments in a single repository.
  • CI/CD Integration: Generate GitHub Actions and Azure Pipelines workflows.
  • Automated Versioning: Interactive CLI for bumping project versions with validation.
  • Flexible Build Flow: Implement the target entries to create custom build flows.

Quick Start

Using the Repository Template

To quickly set up a new project, use the NukeBuildTemplate repository template:

  1. Clone the template repository.
  2. Follow the setup instructions in the template.

Installing via One-Line Script

For a fast installation, you can also use the following one-liner in windows cmd or powershell:

  1. Open either cmd or powershell

  2. Navigate to your project directory

  3. Paste the command:

    C:\Windows\System32\WindowsPowerShell\v1.0\powershell -c "& ([ScriptBlock]::Create((irm https://raw.githubusercontent.com/Kiryuumaru/NukeBuildTemplate/main/init.ps1)))"
    

Installing via NuGet

If you already have a NukeBuild setup, you can install NukeBuildHelpers via NuGet:

dotnet add package NukeBuildHelpers

Usage

Preparing Build class

  1. Change the base class from NukeBuild to BaseNukeBuildHelpers:

    class Build : BaseNukeBuildHelpers
    {
        ...
    }
    
  2. Add your environment branches:

    class Build : BaseNukeBuildHelpers
    {
        ...
    
        public override string[] EnvironmentBranches { get; } = [ "prerelease", "master" ];
    
        public override string MainEnvironmentBranch { get; } = "master";
    }
    

Creating Build Flows

To create custom build flows, implement any of the target entries BuildEntry, TestEntry or PublishEntry.

  • Example BuildEntry Implementation
    class Build : BaseNukeBuildHelpers
    {
        ...
    
        BuildEntry NukeBuildHelpersBuild => _ => _
            .AppId("nuke_build_helpers")
            .RunnerOS(RunnerOS.Ubuntu2204)
            .Execute(context => {
                string version = "0.0.0";
                string? releaseNotes = null;
                if (context.TryGetBumpContext(out var bumpContext))
                {
                    version = bumpContext.AppVersion.Version.ToString();
                    releaseNotes = bumpContext.AppVersion.ReleaseNotes;
                }
                else if (context.TryGetPullRequestContext(out var pullRequestContext))
                {
                    version = pullRequestContext.AppVersion.Version.ToString();
                }
                DotNetTasks.DotNetClean(_ => _
                    .SetProject(RootDirectory / "NukeBuildHelpers" / "NukeBuildHelpers.csproj"));
                DotNetTasks.DotNetBuild(_ => _
                    .SetProjectFile(RootDirectory / "NukeBuildHelpers" / "NukeBuildHelpers.csproj")
                    .SetConfiguration("Release"));
                DotNetTasks.DotNetPack(_ => _
                    .SetProject(RootDirectory / "NukeBuildHelpers" / "NukeBuildHelpers.csproj")
                    .SetConfiguration("Release")
                    .SetNoRestore(true)
                    .SetNoBuild(true)
                    .SetIncludeSymbols(true)
                    .SetSymbolPackageFormat("snupkg")
                    .SetVersion(version)
                    .SetPackageReleaseNotes(releaseNotes)
                    .SetOutputDirectory(OutputDirectory / "main"));
            });
    }
    

    See documentation here

  • Example TestEntry Implementation
    class Build : BaseNukeBuildHelpers
    {
        ...
    
        TestEntry NukeBuildHelpersTest => _ => _
            .AppId("nuke_build_helpers")
            .RunnerOS(RunnerOS.Ubuntu2204)
            .Execute(() =>
            {
                DotNetTasks.DotNetClean(_ => _
                    .SetProject(RootDirectory / "NukeBuildHelpers.UnitTest" / "NukeBuildHelpers.UnitTest.csproj"));
                DotNetTasks.DotNetTest(_ => _
                    .SetProjectFile(RootDirectory / "NukeBuildHelpers.UnitTest" / "NukeBuildHelpers.UnitTest.csproj"));
            });
    }
    

    See documentation here

  • Example PublishEntry Implementation
    class Build : BaseNukeBuildHelpers
    {
        ...
    
        PublishEntry NukeBuildHelpersPublish => _ => _
            .AppId("nuke_build_helpers")
            .RunnerOS(RunnerOS.Ubuntu2204)
            .Execute(context =>
            {
                if (context.RunType == RunType.Bump)
                {
                    DotNetTasks.DotNetNuGetPush(_ => _
                        .SetSource("https://nuget.pkg.github.com/kiryuumaru/index.json")
                        .SetApiKey(GithubToken)
                        .SetTargetPath(OutputDirectory / "main" / "**"));
                    DotNetTasks.DotNetNuGetPush(_ => _
                        .SetSource("https://api.nuget.org/v3/index.json")
                        .SetApiKey(NuGetAuthToken)
                        .SetTargetPath(OutputDirectory / "main" / "**"));
                }
            });
    }
    

    See documentation here

Generating Workflows

  • Generate GitHub and Azure Pipelines workflows using CLI commands:

    # Generate GitHub workflow
    build githubworkflow
    
    # Generate Azure Pipelines workflow
    build azureworkflow
    

    These commands will generate azure-pipelines.yml and .github/workflows/nuke-cicd.yml respectively.

    For advanced workflow configurations, you can utilize the WorkflowConfigEntry by overriding BaseNukeBuildHelpers.WorkflowConfig. See the documentation here for more details on customizing your workflows.

Bumping Project Version

  • Use the build bump command to interactively bump the project version:

    build bump
    

CLI Subcommands

  • Fetch: Fetch git commits and tags.
  • Version: Show the current version from all releases.
  • Bump: Interactive, bump the version by validating and tagging.
  • BumpAndForget: Interactive, bump and forget the version by validating and tagging.
  • StatusWatch: Show the current version status from all releases.
  • Test: Run tests.
  • Build: Build the project.
  • Publish: Publish the project.
  • GithubWorkflow: Build the CI/CD workflow for GitHub.
  • AzureWorkflow: Build the CI/CD workflow for Azure.

Versioning and Status

  • The Version subcommand shows the current version from all releases. Example output from the subcommand:

    ╬═════════════════════╬═════════════╬════════════════════╬═════════════════════╬
    ║        App Id       ║ Environment ║   Bumped Version   ║      Published      ║
    ╬═════════════════════╬═════════════╬════════════════════╬═════════════════════╬
    ║ nuke_build_helpers  ║ prerelease  ║ 2.1.0-prerelease.1 ║ 2.0.0-prerelease.8* ║
    ║                     ║   master    ║ 2.0.0              ║         yes         ║
    ║---------------------║-------------║--------------------║---------------------║
    ║ nuke_build_helpers2 ║ prerelease  ║ 0.1.0-prerelease.2 ║         no          ║
    ║                     ║   master    ║ -                  ║         no          ║
    ╬═════════════════════╬═════════════╬════════════════════╬═════════════════════╬
    
  • The StatusWatch subcommand continuously monitors the version status. Example output from the subcommand:

    ╬═════════════════════╬═════════════╬════════════════════╬═══════════════╬
    ║        App Id       ║ Environment ║      Version       ║    Status     ║
    ╬═════════════════════╬═════════════╬════════════════════╬═══════════════╬
    ║ nuke_build_helpers  ║ prerelease  ║ 2.1.0-prerelease.2 ║   Published   ║
    ║                     ║   master    ║ 2.0.0              ║   Published   ║
    ║---------------------║-------------║--------------------║---------------║
    ║ nuke_build_helpers2 ║ prerelease  ║ 0.1.0-prerelease.2 ║  Run Failed   ║
    ║                     ║   master    ║ -                  ║ Not published ║
    ╬═════════════════════╬═════════════╬════════════════════╬═══════════════╬
    

    Status types include:

    • Run Failed: The build encountered an error and did not complete successfully.
    • Published: The build was successfully published.
    • Publishing: The build is currently in the process of being published.
    • Waiting for Queue: The build is waiting in the queue to be processed.
    • Not Published: The build has not been published.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • NukeBuild for providing the foundation for this project.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.4 362 12/5/2024
7.0.3 731 12/3/2024
7.0.2 846 12/3/2024
7.0.1 642 12/3/2024
7.0.0-prerelease.1 31 12/3/2024
6.4.0-prerelease.1 33 12/3/2024
6.3.30 143 12/2/2024
6.3.29 423 11/25/2024
6.3.28 594 11/22/2024
6.3.26 39 11/22/2024
6.3.25 1,622 11/19/2024
6.3.24 361 11/14/2024
6.3.22 38 11/14/2024
6.3.21 100 11/13/2024
6.3.20 545 11/7/2024
6.3.19 207 11/6/2024
6.3.18 3,493 10/30/2024
6.3.17 547 10/30/2024
6.3.16-prerelease.2 31 10/30/2024
6.3.15 332 10/29/2024
6.3.14 538 10/26/2024
6.3.13 405 10/25/2024
6.3.11 1,055 10/23/2024
6.3.10 417 10/22/2024
6.3.8 43 10/22/2024
6.3.7 891 10/17/2024
6.3.6 191 10/17/2024
6.3.5 717 10/14/2024
6.3.4 245 10/14/2024
6.3.3 685 10/11/2024
6.3.2 107 10/11/2024
6.3.1 38 10/11/2024
6.3.0-prerelease.2 29 10/11/2024
6.2.1 1,112 10/7/2024
6.2.0 673 10/4/2024
6.1.4 452 10/2/2024
6.1.4-prerelease.6 32 10/4/2024
6.1.4-prerelease.5 36 10/4/2024
6.1.3 741 9/27/2024
6.1.2 142 9/27/2024
6.1.1 41 9/27/2024
6.1.0 1,118 9/25/2024
6.0.2 793 9/23/2024
6.0.1 681 9/20/2024
6.0.0 766 9/18/2024
6.0.0-prerelease.4 34 9/18/2024
6.0.0-prerelease.2 35 9/18/2024
6.0.0-prerelease.1 33 9/18/2024
5.1.5 441 9/16/2024
5.1.4 718 9/10/2024
5.1.3 79 9/10/2024
5.1.2 799 9/5/2024
5.1.1 521 9/2/2024
5.1.0 380 8/29/2024
5.0.2 901 8/26/2024
5.0.0 53 8/26/2024
5.0.0-prerelease.13 41 8/26/2024
5.0.0-prerelease.12 35 8/26/2024
5.0.0-prerelease.11 37 8/26/2024
5.0.0-prerelease.10 40 8/26/2024
4.11.0 47 8/26/2024
4.10.4 460 8/22/2024
4.10.3 471 8/20/2024
4.10.2 312 8/19/2024
4.10.1 519 8/14/2024
4.10.0 307 8/14/2024
4.10.0-prerelease.9 36 8/14/2024
4.10.0-prerelease.8 36 8/14/2024
4.10.0-prerelease.7 46 8/14/2024
4.10.0-prerelease.6 38 8/14/2024
4.10.0-prerelease.5 37 8/14/2024
4.10.0-prerelease.4 40 8/13/2024
4.10.0-prerelease.3 36 8/13/2024
4.10.0-prerelease.2 39 8/13/2024
4.10.0-prerelease.1 36 8/13/2024
4.9.6 207 8/13/2024
4.9.5 427 8/13/2024
4.9.5-prerelease.6 45 8/13/2024
4.9.4 60 8/13/2024
4.9.4-prerelease.6 41 8/6/2024
4.9.4-prerelease.5 45 8/5/2024
4.9.4-prerelease.3 34 8/5/2024
4.9.4-prerelease.2 31 8/5/2024
4.9.4-prerelease.1 31 8/5/2024
4.9.3 561 7/31/2024
4.9.2 126 7/31/2024
4.9.1 33 7/31/2024
4.9.0 34 7/31/2024
4.8.0 424 7/26/2024
4.6.5 866 7/16/2024
4.6.4 50 7/16/2024
4.6.3 49 7/16/2024
4.6.2 46 7/16/2024
4.6.0 45 7/16/2024
4.5.8 161 7/15/2024
4.5.7 208 7/14/2024
4.5.4 50 7/14/2024
4.5.3 49 7/14/2024
4.5.2 52 7/14/2024
4.5.1 56 7/14/2024
4.5.0 61 7/13/2024
4.4.0 59 7/13/2024
4.3.1 194 7/13/2024
4.3.0 46 7/13/2024
4.2.1 571 7/12/2024
4.2.0-prerelease.9 44 7/12/2024
4.2.0-prerelease.4 46 7/12/2024
4.2.0-prerelease.3 40 7/12/2024
4.2.0-prerelease.1 41 7/12/2024
4.1.0 46 7/12/2024
4.0.6 363 7/9/2024
4.0.5 46 7/9/2024
4.0.4 755 7/7/2024
4.0.3 46 7/7/2024
4.0.2 54 7/7/2024
4.0.1 224 7/7/2024
4.0.0 193 7/7/2024
4.0.0-prerelease.4 44 7/7/2024
4.0.0-prerelease.2 40 7/7/2024
4.0.0-prerelease.1 44 7/7/2024
3.3.5 52 7/6/2024
3.3.4 246 7/1/2024
3.3.3 199 6/30/2024
3.3.2 48 6/30/2024
3.3.1 54 6/30/2024
3.3.0 49 6/30/2024
3.3.0-prerelease.12 42 6/30/2024
3.2.5 166 6/30/2024
3.2.4 59 6/30/2024
3.2.1 51 6/29/2024
3.2.0 300 6/27/2024
3.1.2 48 6/27/2024
3.0.5 124 6/26/2024
3.0.3 51 6/26/2024
3.0.0 64 6/26/2024
3.0.0-prerelease.3 43 6/26/2024
3.0.0-prerelease.2 47 6/26/2024
3.0.0-prerelease.1 46 6/26/2024
2.7.1 74 6/7/2024
2.7.0 48 6/7/2024
2.7.0-prerelease.1 45 6/7/2024
2.6.1 213 6/4/2024
2.6.1-prerelease.1 47 6/4/2024
2.6.0 127 6/4/2024
2.6.0-prerelease.1 41 6/4/2024
2.5.0 115 6/3/2024
2.5.0-prerelease.4 53 6/3/2024
2.5.0-prerelease.3 34 6/3/2024
2.5.0-prerelease.2 43 6/3/2024
2.5.0-prerelease.1 48 6/3/2024
2.4.1 69 5/29/2024
2.4.0 83 5/29/2024
2.4.0-prerelease.2 50 5/29/2024
2.4.0-prerelease.1 48 5/27/2024
2.3.0 185 5/27/2024
2.3.0-prerelease.1 48 5/27/2024
2.2.0 52 5/27/2024
2.2.0-prerelease.1 48 5/27/2024
2.1.2 100 5/27/2024
2.1.1 56 5/27/2024
2.1.0 179 5/24/2024
2.1.0-prerelease.4 53 5/24/2024
2.1.0-prerelease.3 56 5/24/2024
2.1.0-prerelease.2 42 5/23/2024
2.1.0-prerelease.1 45 5/23/2024
2.0.0 64 5/23/2024
2.0.0-prerelease.8 101 5/22/2024
2.0.0-prerelease.7 59 5/22/2024
2.0.0-prerelease.5 50 5/22/2024
2.0.0-prerelease.4 51 5/22/2024
2.0.0-prerelease.3 52 5/22/2024
1.0.2 548 4/25/2024
1.0.1 609 4/20/2024
1.0.0 424 4/1/2024
0.8.4-prerelease.4 78 3/31/2024
0.8.4-prerelease.2 66 3/31/2024
0.8.4-prerelease.1 54 3/31/2024
0.8.3 172 3/26/2024
0.8.3-prerelease.1 52 3/26/2024
0.8.2 151 3/26/2024
0.8.2-prerelease.2 60 3/26/2024
0.8.2-prerelease.1 57 3/26/2024
0.8.1 165 3/25/2024
0.8.1-prerelease.3 54 3/25/2024
0.8.1-prerelease.1 54 3/25/2024
0.8.0 112 3/25/2024
0.8.0-prerelease.44 60 3/25/2024
0.8.0-prerelease.40 63 3/25/2024
0.8.0-prerelease.39 59 3/25/2024
0.8.0-prerelease.38 59 3/25/2024
0.8.0-prerelease.37 53 3/25/2024
0.8.0-prerelease.36 184 3/22/2024
0.8.0-prerelease.35 59 3/22/2024
0.8.0-prerelease.34 141 3/21/2024
0.8.0-prerelease.33 50 3/21/2024
0.8.0-prerelease.32 63 3/21/2024
0.8.0-prerelease.31 57 3/21/2024
0.8.0-prerelease.28 66 3/21/2024
0.8.0-prerelease.27 60 3/21/2024
0.8.0-prerelease.26 52 3/21/2024
0.8.0-prerelease.25 54 3/21/2024
0.8.0-prerelease.23 53 3/21/2024
0.8.0-prerelease.22 54 3/21/2024
0.8.0-prerelease.21 59 3/21/2024
0.8.0-prerelease.20 49 3/21/2024
0.8.0-prerelease.19 52 3/21/2024
0.8.0-prerelease.18 58 3/21/2024
0.8.0-prerelease.17 57 3/21/2024
0.8.0-prerelease.16 61 3/21/2024
0.8.0-prerelease.15 58 3/21/2024
0.8.0-prerelease.14 51 3/21/2024
0.8.0-prerelease.13 52 3/21/2024
0.8.0-prerelease.12 55 3/21/2024
0.8.0-prerelease.11 51 3/21/2024
0.8.0-prerelease.10 58 3/21/2024
0.8.0-prerelease.9 58 3/21/2024
0.8.0-prerelease.7 325 3/19/2024
0.8.0-prerelease.6 121 3/19/2024
0.8.0-prerelease.5 275 3/13/2024
0.8.0-prerelease.4 64 3/13/2024
0.8.0-prerelease.3 50 3/13/2024
0.8.0-prerelease.2 66 3/13/2024
0.8.0-prerelease.1 53 3/13/2024
0.7.0 131 3/13/2024
0.7.0-prerelease.1 58 3/13/2024
0.6.0-prerelease.1 50 3/12/2024
0.5.0-prerelease.26 46 3/12/2024
0.5.0-prerelease.25 46 3/12/2024
0.5.0-prerelease.24 96 3/11/2024
0.5.0-prerelease.23 57 3/10/2024
0.5.0-prerelease.22 50 3/10/2024
0.5.0-prerelease.20 91 3/10/2024
0.5.0-prerelease.19 58 3/10/2024
0.5.0-prerelease.18 90 3/10/2024
0.5.0-prerelease.17 68 3/10/2024
0.5.0-prerelease.16 54 3/10/2024
0.5.0-prerelease.15 48 3/10/2024
0.5.0-prerelease.14 53 3/10/2024
0.5.0-prerelease.13 55 3/10/2024
0.5.0-prerelease.12 55 3/10/2024
0.5.0-prerelease.11 56 3/9/2024
0.5.0-prerelease.9 63 3/9/2024
0.5.0-prerelease.7 176 3/8/2024
0.5.0-prerelease.6 60 3/8/2024
0.5.0-prerelease.5 59 3/8/2024
0.5.0-prerelease.4 66 3/8/2024
0.4.2 98 3/8/2024
0.4.1 101 3/8/2024
0.4.0 89 3/8/2024
0.4.0-prerelease.46 58 3/8/2024
0.4.0-prerelease.45 35 3/8/2024
0.4.0-prerelease.44 49 3/8/2024
0.4.0-prerelease.42 59 3/8/2024
0.4.0-prerelease.41 52 3/7/2024
0.4.0-prerelease.39 48 3/7/2024
0.4.0-prerelease.37 47 3/7/2024
0.4.0-prerelease.36 49 3/7/2024
0.4.0-prerelease.35 47 3/7/2024
0.4.0-prerelease.34 53 3/7/2024
0.4.0-prerelease.33 51 3/7/2024
0.4.0-prerelease.32 52 3/7/2024
0.4.0-prerelease.28 54 3/7/2024
0.4.0-prerelease.27 45 3/7/2024
0.4.0-prerelease.25 49 3/7/2024
0.4.0-prerelease.24 50 3/7/2024
0.4.0-prerelease.23 51 3/7/2024
0.4.0-prerelease.22 51 3/7/2024
0.4.0-prerelease.21 57 3/7/2024
0.4.0-prerelease.20 52 3/7/2024
0.4.0-prerelease.19 51 3/7/2024
0.4.0-prerelease.18 53 3/7/2024
0.4.0-prerelease.17 59 3/7/2024
0.4.0-prerelease.16 51 3/7/2024
0.4.0-prerelease.15 51 3/7/2024
0.4.0-prerelease.14 55 3/7/2024
0.4.0-prerelease.13 53 3/7/2024
0.3.0 117 3/5/2024
0.3.0-prerelease.3 59 3/5/2024
0.2.0 113 3/5/2024
0.1.0 128 3/5/2024
0.1.0-prerelease.22 56 3/5/2024
0.1.0-prerelease.19 49 3/5/2024
0.1.0-prerelease.18 52 3/5/2024
0.1.0-prerelease.17 53 3/5/2024
0.1.0-prerelease.13 61 3/5/2024
0.1.0-prerelease.12 63 3/5/2024
0.1.0-prerelease.10 61 3/5/2024
0.1.0-prerelease.9 60 3/5/2024
0.1.0-prerelease.8 57 3/5/2024
0.1.0-prerelease.7 59 3/5/2024
0.1.0-prerelease.5 60 3/5/2024
0.1.0-prerelease.4 51 3/5/2024
0.1.0-prerelease.3 58 3/5/2024
0.1.0-prerelease.2 56 3/5/2024
0.1.0-prerelease.1 143 12/13/2023
0.1.0-alpha.1 66 3/5/2024

## New Version
* Bump `nuke_build_helpers` from `7.0.3` to `7.0.4`. See [changelog](https://github.com/Kiryuumaru/NukeBuildHelpers/compare/nuke_build_helpers/7.0.3...nuke_build_helpers/7.0.4)

## What's Changed
* Cleaner logs by @Kiryuumaru in https://github.com/Kiryuumaru/NukeBuildHelpers/pull/204
* Bump NuGet.Packaging, Nuke.Common and YamlDotNet by @dependabot in https://github.com/Kiryuumaru/NukeBuildHelpers/pull/205

**Full Changelog**: https://github.com/Kiryuumaru/NukeBuildHelpers/compare/build.539...build.540