NukeBuildHelpers 6.3.1

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

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

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. 
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.21 1 11/13/2024
6.3.20 384 11/7/2024
6.3.19 189 11/6/2024
6.3.18 2,129 10/30/2024
6.3.17 542 10/30/2024
6.3.16-prerelease.2 30 10/30/2024
6.3.15 327 10/29/2024
6.3.14 533 10/26/2024
6.3.13 400 10/25/2024
6.3.11 1,050 10/23/2024
6.3.10 412 10/22/2024
6.3.8 38 10/22/2024
6.3.7 882 10/17/2024
6.3.6 186 10/17/2024
6.3.5 712 10/14/2024
6.3.4 240 10/14/2024
6.3.3 680 10/11/2024
6.3.2 102 10/11/2024
6.3.1 33 10/11/2024
6.3.0-prerelease.2 28 10/11/2024
6.2.1 1,107 10/7/2024
6.2.0 668 10/4/2024
6.1.4 447 10/2/2024
6.1.4-prerelease.6 31 10/4/2024
6.1.4-prerelease.5 35 10/4/2024
6.1.3 738 9/27/2024
6.1.2 136 9/27/2024
6.1.1 38 9/27/2024
6.1.0 1,115 9/25/2024
6.0.2 790 9/23/2024
6.0.1 678 9/20/2024
6.0.0 763 9/18/2024
6.0.0-prerelease.4 33 9/18/2024
6.0.0-prerelease.2 34 9/18/2024
6.0.0-prerelease.1 32 9/18/2024
5.1.5 438 9/16/2024
5.1.4 713 9/10/2024
5.1.3 76 9/10/2024
5.1.2 796 9/5/2024
5.1.1 518 9/2/2024
5.1.0 377 8/29/2024
5.0.2 898 8/26/2024
5.0.0 50 8/26/2024
5.0.0-prerelease.13 40 8/26/2024
5.0.0-prerelease.12 34 8/26/2024
5.0.0-prerelease.11 36 8/26/2024
5.0.0-prerelease.10 39 8/26/2024
4.11.0 44 8/26/2024
4.10.4 457 8/22/2024
4.10.3 468 8/20/2024
4.10.2 309 8/19/2024
4.10.1 516 8/14/2024
4.10.0 304 8/14/2024
4.10.0-prerelease.9 35 8/14/2024
4.10.0-prerelease.8 35 8/14/2024
4.10.0-prerelease.7 45 8/14/2024
4.10.0-prerelease.6 37 8/14/2024
4.10.0-prerelease.5 36 8/14/2024
4.10.0-prerelease.4 39 8/13/2024
4.10.0-prerelease.3 35 8/13/2024
4.10.0-prerelease.2 38 8/13/2024
4.10.0-prerelease.1 35 8/13/2024
4.9.6 204 8/13/2024
4.9.5 424 8/13/2024
4.9.5-prerelease.6 39 8/13/2024
4.9.4 57 8/13/2024
4.9.4-prerelease.6 40 8/6/2024
4.9.4-prerelease.5 44 8/5/2024
4.9.4-prerelease.3 33 8/5/2024
4.9.4-prerelease.2 30 8/5/2024
4.9.4-prerelease.1 30 8/5/2024
4.9.3 558 7/31/2024
4.9.2 123 7/31/2024
4.9.1 30 7/31/2024
4.9.0 31 7/31/2024
4.8.0 421 7/26/2024
4.6.5 863 7/16/2024
4.6.4 47 7/16/2024
4.6.3 46 7/16/2024
4.6.2 43 7/16/2024
4.6.0 42 7/16/2024
4.5.8 158 7/15/2024
4.5.7 205 7/14/2024
4.5.4 47 7/14/2024
4.5.3 46 7/14/2024
4.5.2 49 7/14/2024
4.5.1 53 7/14/2024
4.5.0 58 7/13/2024
4.4.0 56 7/13/2024
4.3.1 191 7/13/2024
4.3.0 43 7/13/2024
4.2.1 559 7/12/2024
4.2.0-prerelease.9 43 7/12/2024
4.2.0-prerelease.4 45 7/12/2024
4.2.0-prerelease.3 39 7/12/2024
4.2.0-prerelease.1 40 7/12/2024
4.1.0 43 7/12/2024
4.0.6 360 7/9/2024
4.0.5 43 7/9/2024
4.0.4 752 7/7/2024
4.0.3 43 7/7/2024
4.0.2 51 7/7/2024
4.0.1 221 7/7/2024
4.0.0 190 7/7/2024
4.0.0-prerelease.4 43 7/7/2024
4.0.0-prerelease.2 39 7/7/2024
4.0.0-prerelease.1 43 7/7/2024
3.3.5 49 7/6/2024
3.3.4 243 7/1/2024
3.3.3 196 6/30/2024
3.3.2 45 6/30/2024
3.3.1 51 6/30/2024
3.3.0 46 6/30/2024
3.3.0-prerelease.12 41 6/30/2024
3.2.5 163 6/30/2024
3.2.4 56 6/30/2024
3.2.1 48 6/29/2024
3.2.0 297 6/27/2024
3.1.2 45 6/27/2024
3.0.5 121 6/26/2024
3.0.3 48 6/26/2024
3.0.0 61 6/26/2024
3.0.0-prerelease.3 42 6/26/2024
3.0.0-prerelease.2 46 6/26/2024
3.0.0-prerelease.1 45 6/26/2024
2.7.1 71 6/7/2024
2.7.0 45 6/7/2024
2.7.0-prerelease.1 44 6/7/2024
2.6.1 210 6/4/2024
2.6.1-prerelease.1 46 6/4/2024
2.6.0 124 6/4/2024
2.6.0-prerelease.1 40 6/4/2024
2.5.0 112 6/3/2024
2.5.0-prerelease.4 52 6/3/2024
2.5.0-prerelease.3 33 6/3/2024
2.5.0-prerelease.2 42 6/3/2024
2.5.0-prerelease.1 47 6/3/2024
2.4.1 66 5/29/2024
2.4.0 80 5/29/2024
2.4.0-prerelease.2 49 5/29/2024
2.4.0-prerelease.1 47 5/27/2024
2.3.0 182 5/27/2024
2.3.0-prerelease.1 47 5/27/2024
2.2.0 49 5/27/2024
2.2.0-prerelease.1 47 5/27/2024
2.1.2 97 5/27/2024
2.1.1 53 5/27/2024
2.1.0 176 5/24/2024
2.1.0-prerelease.4 52 5/24/2024
2.1.0-prerelease.3 55 5/24/2024
2.1.0-prerelease.2 41 5/23/2024
2.1.0-prerelease.1 44 5/23/2024
2.0.0 61 5/23/2024
2.0.0-prerelease.8 100 5/22/2024
2.0.0-prerelease.7 58 5/22/2024
2.0.0-prerelease.5 49 5/22/2024
2.0.0-prerelease.4 50 5/22/2024
2.0.0-prerelease.3 51 5/22/2024
1.0.2 545 4/25/2024
1.0.1 604 4/20/2024
1.0.0 421 4/1/2024
0.8.4-prerelease.4 75 3/31/2024
0.8.4-prerelease.2 65 3/31/2024
0.8.4-prerelease.1 53 3/31/2024
0.8.3 169 3/26/2024
0.8.3-prerelease.1 51 3/26/2024
0.8.2 148 3/26/2024
0.8.2-prerelease.2 59 3/26/2024
0.8.2-prerelease.1 56 3/26/2024
0.8.1 158 3/25/2024
0.8.1-prerelease.3 53 3/25/2024
0.8.1-prerelease.1 53 3/25/2024
0.8.0 109 3/25/2024
0.8.0-prerelease.44 59 3/25/2024
0.8.0-prerelease.40 62 3/25/2024
0.8.0-prerelease.39 58 3/25/2024
0.8.0-prerelease.38 58 3/25/2024
0.8.0-prerelease.37 52 3/25/2024
0.8.0-prerelease.36 183 3/22/2024
0.8.0-prerelease.35 58 3/22/2024
0.8.0-prerelease.34 140 3/21/2024
0.8.0-prerelease.33 49 3/21/2024
0.8.0-prerelease.32 62 3/21/2024
0.8.0-prerelease.31 56 3/21/2024
0.8.0-prerelease.28 65 3/21/2024
0.8.0-prerelease.27 59 3/21/2024
0.8.0-prerelease.26 51 3/21/2024
0.8.0-prerelease.25 53 3/21/2024
0.8.0-prerelease.23 52 3/21/2024
0.8.0-prerelease.22 53 3/21/2024
0.8.0-prerelease.21 58 3/21/2024
0.8.0-prerelease.20 48 3/21/2024
0.8.0-prerelease.19 51 3/21/2024
0.8.0-prerelease.18 57 3/21/2024
0.8.0-prerelease.17 52 3/21/2024
0.8.0-prerelease.16 60 3/21/2024
0.8.0-prerelease.15 56 3/21/2024
0.8.0-prerelease.14 49 3/21/2024
0.8.0-prerelease.13 50 3/21/2024
0.8.0-prerelease.12 53 3/21/2024
0.8.0-prerelease.11 45 3/21/2024
0.8.0-prerelease.10 57 3/21/2024
0.8.0-prerelease.9 57 3/21/2024
0.8.0-prerelease.7 324 3/19/2024
0.8.0-prerelease.6 116 3/19/2024
0.8.0-prerelease.5 272 3/13/2024
0.8.0-prerelease.4 63 3/13/2024
0.8.0-prerelease.3 49 3/13/2024
0.8.0-prerelease.2 65 3/13/2024
0.8.0-prerelease.1 48 3/13/2024
0.7.0 128 3/13/2024
0.7.0-prerelease.1 55 3/13/2024
0.6.0-prerelease.1 49 3/12/2024
0.5.0-prerelease.26 45 3/12/2024
0.5.0-prerelease.25 45 3/12/2024
0.5.0-prerelease.24 95 3/11/2024
0.5.0-prerelease.23 56 3/10/2024
0.5.0-prerelease.22 49 3/10/2024
0.5.0-prerelease.20 90 3/10/2024
0.5.0-prerelease.19 57 3/10/2024
0.5.0-prerelease.18 89 3/10/2024
0.5.0-prerelease.17 67 3/10/2024
0.5.0-prerelease.16 53 3/10/2024
0.5.0-prerelease.15 47 3/10/2024
0.5.0-prerelease.14 52 3/10/2024
0.5.0-prerelease.13 51 3/10/2024
0.5.0-prerelease.12 53 3/10/2024
0.5.0-prerelease.11 54 3/9/2024
0.5.0-prerelease.9 59 3/9/2024
0.5.0-prerelease.7 174 3/8/2024
0.5.0-prerelease.6 58 3/8/2024
0.5.0-prerelease.5 57 3/8/2024
0.5.0-prerelease.4 62 3/8/2024
0.4.2 95 3/8/2024
0.4.1 98 3/8/2024
0.4.0 86 3/8/2024
0.4.0-prerelease.46 56 3/8/2024
0.4.0-prerelease.45 33 3/8/2024
0.4.0-prerelease.44 47 3/8/2024
0.4.0-prerelease.42 57 3/8/2024
0.4.0-prerelease.41 50 3/7/2024
0.4.0-prerelease.39 46 3/7/2024
0.4.0-prerelease.37 45 3/7/2024
0.4.0-prerelease.36 47 3/7/2024
0.4.0-prerelease.35 45 3/7/2024
0.4.0-prerelease.34 51 3/7/2024
0.4.0-prerelease.33 49 3/7/2024
0.4.0-prerelease.32 50 3/7/2024
0.4.0-prerelease.28 52 3/7/2024
0.4.0-prerelease.27 43 3/7/2024
0.4.0-prerelease.25 47 3/7/2024
0.4.0-prerelease.24 46 3/7/2024
0.4.0-prerelease.23 49 3/7/2024
0.4.0-prerelease.22 49 3/7/2024
0.4.0-prerelease.21 55 3/7/2024
0.4.0-prerelease.20 50 3/7/2024
0.4.0-prerelease.19 49 3/7/2024
0.4.0-prerelease.18 51 3/7/2024
0.4.0-prerelease.17 55 3/7/2024
0.4.0-prerelease.16 49 3/7/2024
0.4.0-prerelease.15 49 3/7/2024
0.4.0-prerelease.14 51 3/7/2024
0.4.0-prerelease.13 51 3/7/2024
0.3.0 112 3/5/2024
0.3.0-prerelease.3 57 3/5/2024
0.2.0 110 3/5/2024
0.1.0 121 3/5/2024
0.1.0-prerelease.22 54 3/5/2024
0.1.0-prerelease.19 47 3/5/2024
0.1.0-prerelease.18 50 3/5/2024
0.1.0-prerelease.17 51 3/5/2024
0.1.0-prerelease.13 59 3/5/2024
0.1.0-prerelease.12 61 3/5/2024
0.1.0-prerelease.10 60 3/5/2024
0.1.0-prerelease.9 57 3/5/2024
0.1.0-prerelease.8 56 3/5/2024
0.1.0-prerelease.7 58 3/5/2024
0.1.0-prerelease.5 59 3/5/2024
0.1.0-prerelease.4 50 3/5/2024
0.1.0-prerelease.3 57 3/5/2024
0.1.0-prerelease.2 55 3/5/2024
0.1.0-prerelease.1 140 12/13/2023
0.1.0-alpha.1 65 3/5/2024

## New Versions
* Bump `nuke_build_helpers` from `6.2.1` to `6.3.1`. See [changelog](https://github.com/Kiryuumaru/NukeBuildHelpers/compare/nuke_build_helpers/6.2.1...nuke_build_helpers/6.3.1)

## What's Changed
* Bump release `6.3.0` by @Kiryuumaru in https://github.com/Kiryuumaru/NukeBuildHelpers/pull/166
* Fixed command bump on enabled `UseJsonFileVersioning` by @Kiryuumaru in https://github.com/Kiryuumaru/NukeBuildHelpers/pull/167


**Full Changelog**: https://github.com/Kiryuumaru/NukeBuildHelpers/compare/build.498...build.502