NukeBuildHelpers 4.10.0-prerelease.8

This is a prerelease version of NukeBuildHelpers.
This package has a SemVer 2.0.0 package version: 4.10.0-prerelease.8+build.462.
There is a newer version of this package available.
See the version list below for details.
dotnet add package NukeBuildHelpers --version 4.10.0-prerelease.8                
NuGet\Install-Package NukeBuildHelpers -Version 4.10.0-prerelease.8                
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="4.10.0-prerelease.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NukeBuildHelpers --version 4.10.0-prerelease.8                
#r "nuget: NukeBuildHelpers, 4.10.0-prerelease.8"                
#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=4.10.0-prerelease.8&prerelease

// Install NukeBuildHelpers as a Cake Tool
#tool nuget:?package=NukeBuildHelpers&version=4.10.0-prerelease.8&prerelease                

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 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 TestEntry, BuildEntry or PublishEntry.

  • 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 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 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. 
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
6.3.29 278 11/25/2024
6.3.28 572 11/22/2024
6.3.26 34 11/22/2024
6.3.25 915 11/19/2024
6.3.24 347 11/14/2024
6.3.22 29 11/14/2024
6.3.21 91 11/13/2024
6.3.20 540 11/7/2024
6.3.19 203 11/6/2024
6.3.18 3,354 10/30/2024
6.3.17 545 10/30/2024
6.3.16-prerelease.2 31 10/30/2024
6.3.15 330 10/29/2024
6.3.14 536 10/26/2024
6.3.13 403 10/25/2024
6.3.11 1,053 10/23/2024
6.3.10 415 10/22/2024
6.3.8 41 10/22/2024
6.3.7 885 10/17/2024
6.3.6 189 10/17/2024
6.3.5 715 10/14/2024
6.3.4 243 10/14/2024
6.3.3 683 10/11/2024
6.3.2 105 10/11/2024
6.3.1 36 10/11/2024
6.3.0-prerelease.2 29 10/11/2024
6.2.1 1,110 10/7/2024
6.2.0 671 10/4/2024
6.1.4 450 10/2/2024
6.1.4-prerelease.6 32 10/4/2024
6.1.4-prerelease.5 36 10/4/2024
6.1.3 739 9/27/2024
6.1.2 137 9/27/2024
6.1.1 39 9/27/2024
6.1.0 1,116 9/25/2024
6.0.2 791 9/23/2024
6.0.1 679 9/20/2024
6.0.0 764 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 439 9/16/2024
5.1.4 714 9/10/2024
5.1.3 77 9/10/2024
5.1.2 797 9/5/2024
5.1.1 519 9/2/2024
5.1.0 378 8/29/2024
5.0.2 899 8/26/2024
5.0.0 51 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 45 8/26/2024
4.10.4 458 8/22/2024
4.10.3 469 8/20/2024
4.10.2 310 8/19/2024
4.10.1 517 8/14/2024
4.10.0 305 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 205 8/13/2024
4.9.5 425 8/13/2024
4.9.5-prerelease.6 40 8/13/2024
4.9.4 58 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 559 7/31/2024
4.9.2 124 7/31/2024
4.9.1 31 7/31/2024
4.9.0 32 7/31/2024
4.8.0 422 7/26/2024
4.6.5 864 7/16/2024
4.6.4 48 7/16/2024
4.6.3 47 7/16/2024
4.6.2 44 7/16/2024
4.6.0 43 7/16/2024
4.5.8 159 7/15/2024
4.5.7 206 7/14/2024
4.5.4 48 7/14/2024
4.5.3 47 7/14/2024
4.5.2 50 7/14/2024
4.5.1 54 7/14/2024
4.5.0 59 7/13/2024
4.4.0 57 7/13/2024
4.3.1 192 7/13/2024
4.3.0 44 7/13/2024
4.2.1 560 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 44 7/12/2024
4.0.6 361 7/9/2024
4.0.5 44 7/9/2024
4.0.4 753 7/7/2024
4.0.3 44 7/7/2024
4.0.2 52 7/7/2024
4.0.1 222 7/7/2024
4.0.0 191 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 50 7/6/2024
3.3.4 244 7/1/2024
3.3.3 197 6/30/2024
3.3.2 46 6/30/2024
3.3.1 52 6/30/2024
3.3.0 47 6/30/2024
3.3.0-prerelease.12 42 6/30/2024
3.2.5 164 6/30/2024
3.2.4 57 6/30/2024
3.2.1 49 6/29/2024
3.2.0 298 6/27/2024
3.1.2 46 6/27/2024
3.0.5 122 6/26/2024
3.0.3 49 6/26/2024
3.0.0 62 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 72 6/7/2024
2.7.0 46 6/7/2024
2.7.0-prerelease.1 45 6/7/2024
2.6.1 211 6/4/2024
2.6.1-prerelease.1 47 6/4/2024
2.6.0 125 6/4/2024
2.6.0-prerelease.1 41 6/4/2024
2.5.0 113 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 67 5/29/2024
2.4.0 81 5/29/2024
2.4.0-prerelease.2 50 5/29/2024
2.4.0-prerelease.1 48 5/27/2024
2.3.0 183 5/27/2024
2.3.0-prerelease.1 48 5/27/2024
2.2.0 50 5/27/2024
2.2.0-prerelease.1 48 5/27/2024
2.1.2 98 5/27/2024
2.1.1 54 5/27/2024
2.1.0 177 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 62 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 546 4/25/2024
1.0.1 605 4/20/2024
1.0.0 422 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 170 3/26/2024
0.8.3-prerelease.1 52 3/26/2024
0.8.2 149 3/26/2024
0.8.2-prerelease.2 60 3/26/2024
0.8.2-prerelease.1 57 3/26/2024
0.8.1 161 3/25/2024
0.8.1-prerelease.3 54 3/25/2024
0.8.1-prerelease.1 54 3/25/2024
0.8.0 110 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 55 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 49 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 117 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 49 3/13/2024
0.7.0 129 3/13/2024
0.7.0-prerelease.1 56 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 52 3/10/2024
0.5.0-prerelease.12 54 3/10/2024
0.5.0-prerelease.11 55 3/9/2024
0.5.0-prerelease.9 62 3/9/2024
0.5.0-prerelease.7 175 3/8/2024
0.5.0-prerelease.6 59 3/8/2024
0.5.0-prerelease.5 58 3/8/2024
0.5.0-prerelease.4 65 3/8/2024
0.4.2 96 3/8/2024
0.4.1 99 3/8/2024
0.4.0 87 3/8/2024
0.4.0-prerelease.46 57 3/8/2024
0.4.0-prerelease.45 34 3/8/2024
0.4.0-prerelease.44 48 3/8/2024
0.4.0-prerelease.42 58 3/8/2024
0.4.0-prerelease.41 51 3/7/2024
0.4.0-prerelease.39 47 3/7/2024
0.4.0-prerelease.37 46 3/7/2024
0.4.0-prerelease.36 48 3/7/2024
0.4.0-prerelease.35 46 3/7/2024
0.4.0-prerelease.34 52 3/7/2024
0.4.0-prerelease.33 50 3/7/2024
0.4.0-prerelease.32 51 3/7/2024
0.4.0-prerelease.28 53 3/7/2024
0.4.0-prerelease.27 44 3/7/2024
0.4.0-prerelease.25 48 3/7/2024
0.4.0-prerelease.24 47 3/7/2024
0.4.0-prerelease.23 50 3/7/2024
0.4.0-prerelease.22 50 3/7/2024
0.4.0-prerelease.21 56 3/7/2024
0.4.0-prerelease.20 51 3/7/2024
0.4.0-prerelease.19 50 3/7/2024
0.4.0-prerelease.18 52 3/7/2024
0.4.0-prerelease.17 56 3/7/2024
0.4.0-prerelease.16 50 3/7/2024
0.4.0-prerelease.15 50 3/7/2024
0.4.0-prerelease.14 53 3/7/2024
0.4.0-prerelease.13 53 3/7/2024
0.3.0 115 3/5/2024
0.3.0-prerelease.3 59 3/5/2024
0.2.0 111 3/5/2024
0.1.0 122 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