NukeBuildHelpers 7.0.5

This package has a SemVer 2.0.0 package version: 7.0.5+build.541.
dotnet add package NukeBuildHelpers --version 7.0.5                
NuGet\Install-Package NukeBuildHelpers -Version 7.0.5                
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.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NukeBuildHelpers --version 7.0.5                
#r "nuget: NukeBuildHelpers, 7.0.5"                
#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.5

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

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.5 239 12/18/2024
7.0.4 583 12/5/2024
7.0.3 812 12/3/2024
7.0.2 1,021 12/3/2024
7.0.1 841 12/3/2024
7.0.0-prerelease.1 34 12/3/2024
6.4.0-prerelease.1 37 12/3/2024
6.3.30 153 12/2/2024
6.3.29 425 11/25/2024
6.3.28 596 11/22/2024
6.3.26 43 11/22/2024
6.3.25 1,797 11/19/2024
6.3.24 365 11/14/2024
6.3.22 42 11/14/2024
6.3.21 102 11/13/2024
6.3.20 547 11/7/2024
6.3.19 209 11/6/2024
6.3.18 3,495 10/30/2024
6.3.17 549 10/30/2024
6.3.16-prerelease.2 35 10/30/2024
6.3.15 336 10/29/2024
6.3.14 540 10/26/2024
6.3.13 407 10/25/2024
6.3.11 1,057 10/23/2024
6.3.10 419 10/22/2024
6.3.8 45 10/22/2024
6.3.7 893 10/17/2024
6.3.6 194 10/17/2024
6.3.5 719 10/14/2024
6.3.4 249 10/14/2024
6.3.3 687 10/11/2024
6.3.2 111 10/11/2024
6.3.1 40 10/11/2024
6.3.0-prerelease.2 35 10/11/2024
6.2.1 1,114 10/7/2024
6.2.0 677 10/4/2024
6.1.4 455 10/2/2024
6.1.4-prerelease.6 34 10/4/2024
6.1.4-prerelease.5 38 10/4/2024
6.1.3 743 9/27/2024
6.1.2 145 9/27/2024
6.1.1 43 9/27/2024
6.1.0 1,122 9/25/2024
6.0.2 796 9/23/2024
6.0.1 683 9/20/2024
6.0.0 770 9/18/2024
6.0.0-prerelease.4 36 9/18/2024
6.0.0-prerelease.2 37 9/18/2024
6.0.0-prerelease.1 35 9/18/2024
5.1.5 446 9/16/2024
5.1.4 722 9/10/2024
5.1.3 81 9/10/2024
5.1.2 801 9/5/2024
5.1.1 523 9/2/2024
5.1.0 384 8/29/2024
5.0.2 903 8/26/2024
5.0.0 55 8/26/2024
5.0.0-prerelease.13 43 8/26/2024
5.0.0-prerelease.12 37 8/26/2024
5.0.0-prerelease.11 39 8/26/2024
5.0.0-prerelease.10 42 8/26/2024
4.11.0 49 8/26/2024
4.10.4 462 8/22/2024
4.10.3 473 8/20/2024
4.10.2 314 8/19/2024
4.10.1 521 8/14/2024
4.10.0 309 8/14/2024
4.10.0-prerelease.9 40 8/14/2024
4.10.0-prerelease.8 40 8/14/2024
4.10.0-prerelease.7 48 8/14/2024
4.10.0-prerelease.6 40 8/14/2024
4.10.0-prerelease.5 39 8/14/2024
4.10.0-prerelease.4 42 8/13/2024
4.10.0-prerelease.3 38 8/13/2024
4.10.0-prerelease.2 41 8/13/2024
4.10.0-prerelease.1 38 8/13/2024
4.9.6 209 8/13/2024
4.9.5 429 8/13/2024
4.9.5-prerelease.6 47 8/13/2024
4.9.4 62 8/13/2024
4.9.4-prerelease.6 43 8/6/2024
4.9.4-prerelease.5 47 8/5/2024
4.9.4-prerelease.3 36 8/5/2024
4.9.4-prerelease.2 33 8/5/2024
4.9.4-prerelease.1 33 8/5/2024
4.9.3 563 7/31/2024
4.9.2 128 7/31/2024
4.9.1 36 7/31/2024
4.9.0 38 7/31/2024
4.8.0 428 7/26/2024
4.6.5 869 7/16/2024
4.6.4 53 7/16/2024
4.6.3 51 7/16/2024
4.6.2 48 7/16/2024
4.6.0 50 7/16/2024
4.5.8 164 7/15/2024
4.5.7 210 7/14/2024
4.5.4 53 7/14/2024
4.5.3 51 7/14/2024
4.5.2 54 7/14/2024
4.5.1 59 7/14/2024
4.5.0 64 7/13/2024
4.4.0 64 7/13/2024
4.3.1 199 7/13/2024
4.3.0 48 7/13/2024
4.2.1 574 7/12/2024
4.2.0-prerelease.9 47 7/12/2024
4.2.0-prerelease.4 49 7/12/2024
4.2.0-prerelease.3 43 7/12/2024
4.2.0-prerelease.1 44 7/12/2024
4.1.0 49 7/12/2024
4.0.6 368 7/9/2024
4.0.5 49 7/9/2024
4.0.4 757 7/7/2024
4.0.3 48 7/7/2024
4.0.2 56 7/7/2024
4.0.1 226 7/7/2024
4.0.0 196 7/7/2024
4.0.0-prerelease.4 48 7/7/2024
4.0.0-prerelease.2 42 7/7/2024
4.0.0-prerelease.1 46 7/7/2024
3.3.5 55 7/6/2024
3.3.4 251 7/1/2024
3.3.3 202 6/30/2024
3.3.2 51 6/30/2024
3.3.1 59 6/30/2024
3.3.0 52 6/30/2024
3.3.0-prerelease.12 45 6/30/2024
3.2.5 169 6/30/2024
3.2.4 62 6/30/2024
3.2.1 54 6/29/2024
3.2.0 303 6/27/2024
3.1.2 50 6/27/2024
3.0.5 129 6/26/2024
3.0.3 54 6/26/2024
3.0.0 67 6/26/2024
3.0.0-prerelease.3 45 6/26/2024
3.0.0-prerelease.2 50 6/26/2024
3.0.0-prerelease.1 48 6/26/2024
2.7.1 77 6/7/2024
2.7.0 50 6/7/2024
2.7.0-prerelease.1 48 6/7/2024
2.6.1 216 6/4/2024
2.6.1-prerelease.1 50 6/4/2024
2.6.0 130 6/4/2024
2.6.0-prerelease.1 43 6/4/2024
2.5.0 118 6/3/2024
2.5.0-prerelease.4 56 6/3/2024
2.5.0-prerelease.3 37 6/3/2024
2.5.0-prerelease.2 45 6/3/2024
2.5.0-prerelease.1 51 6/3/2024
2.4.1 73 5/29/2024
2.4.0 85 5/29/2024
2.4.0-prerelease.2 52 5/29/2024
2.4.0-prerelease.1 51 5/27/2024
2.3.0 187 5/27/2024
2.3.0-prerelease.1 51 5/27/2024
2.2.0 55 5/27/2024
2.2.0-prerelease.1 51 5/27/2024
2.1.2 103 5/27/2024
2.1.1 61 5/27/2024
2.1.0 182 5/24/2024
2.1.0-prerelease.4 56 5/24/2024
2.1.0-prerelease.3 58 5/24/2024
2.1.0-prerelease.2 45 5/23/2024
2.1.0-prerelease.1 48 5/23/2024
2.0.0 67 5/23/2024
2.0.0-prerelease.8 104 5/22/2024
2.0.0-prerelease.7 62 5/22/2024
2.0.0-prerelease.5 53 5/22/2024
2.0.0-prerelease.4 54 5/22/2024
2.0.0-prerelease.3 55 5/22/2024
1.0.2 551 4/25/2024
1.0.1 612 4/20/2024
1.0.0 427 4/1/2024
0.8.4-prerelease.4 81 3/31/2024
0.8.4-prerelease.2 69 3/31/2024
0.8.4-prerelease.1 57 3/31/2024
0.8.3 175 3/26/2024
0.8.3-prerelease.1 54 3/26/2024
0.8.2 156 3/26/2024
0.8.2-prerelease.2 65 3/26/2024
0.8.2-prerelease.1 60 3/26/2024
0.8.1 169 3/25/2024
0.8.1-prerelease.3 57 3/25/2024
0.8.1-prerelease.1 57 3/25/2024
0.8.0 115 3/25/2024
0.8.0-prerelease.44 64 3/25/2024
0.8.0-prerelease.40 67 3/25/2024
0.8.0-prerelease.39 63 3/25/2024
0.8.0-prerelease.38 62 3/25/2024
0.8.0-prerelease.37 56 3/25/2024
0.8.0-prerelease.36 190 3/22/2024
0.8.0-prerelease.35 63 3/22/2024
0.8.0-prerelease.34 144 3/21/2024
0.8.0-prerelease.33 53 3/21/2024
0.8.0-prerelease.32 67 3/21/2024
0.8.0-prerelease.31 61 3/21/2024
0.8.0-prerelease.28 69 3/21/2024
0.8.0-prerelease.27 63 3/21/2024
0.8.0-prerelease.26 55 3/21/2024
0.8.0-prerelease.25 58 3/21/2024
0.8.0-prerelease.23 57 3/21/2024
0.8.0-prerelease.22 57 3/21/2024
0.8.0-prerelease.21 65 3/21/2024
0.8.0-prerelease.20 55 3/21/2024
0.8.0-prerelease.19 56 3/21/2024
0.8.0-prerelease.18 64 3/21/2024
0.8.0-prerelease.17 62 3/21/2024
0.8.0-prerelease.16 67 3/21/2024
0.8.0-prerelease.15 62 3/21/2024
0.8.0-prerelease.14 55 3/21/2024
0.8.0-prerelease.13 56 3/21/2024
0.8.0-prerelease.12 59 3/21/2024
0.8.0-prerelease.11 55 3/21/2024
0.8.0-prerelease.10 63 3/21/2024
0.8.0-prerelease.9 61 3/21/2024
0.8.0-prerelease.7 331 3/19/2024
0.8.0-prerelease.6 125 3/19/2024
0.8.0-prerelease.5 279 3/13/2024
0.8.0-prerelease.4 68 3/13/2024
0.8.0-prerelease.3 52 3/13/2024
0.8.0-prerelease.2 69 3/13/2024
0.8.0-prerelease.1 55 3/13/2024
0.7.0 134 3/13/2024
0.7.0-prerelease.1 61 3/13/2024
0.6.0-prerelease.1 54 3/12/2024
0.5.0-prerelease.26 50 3/12/2024
0.5.0-prerelease.25 49 3/12/2024
0.5.0-prerelease.24 100 3/11/2024
0.5.0-prerelease.23 61 3/10/2024
0.5.0-prerelease.22 54 3/10/2024
0.5.0-prerelease.20 95 3/10/2024
0.5.0-prerelease.19 62 3/10/2024
0.5.0-prerelease.18 93 3/10/2024
0.5.0-prerelease.17 72 3/10/2024
0.5.0-prerelease.16 60 3/10/2024
0.5.0-prerelease.15 53 3/10/2024
0.5.0-prerelease.14 57 3/10/2024
0.5.0-prerelease.13 58 3/10/2024
0.5.0-prerelease.12 59 3/10/2024
0.5.0-prerelease.11 60 3/9/2024
0.5.0-prerelease.9 67 3/9/2024
0.5.0-prerelease.7 179 3/8/2024
0.5.0-prerelease.6 63 3/8/2024
0.5.0-prerelease.5 63 3/8/2024
0.5.0-prerelease.4 70 3/8/2024
0.4.2 106 3/8/2024
0.4.1 105 3/8/2024
0.4.0 92 3/8/2024
0.4.0-prerelease.46 60 3/8/2024
0.4.0-prerelease.45 39 3/8/2024
0.4.0-prerelease.44 53 3/8/2024
0.4.0-prerelease.42 61 3/8/2024
0.4.0-prerelease.41 56 3/7/2024
0.4.0-prerelease.39 51 3/7/2024
0.4.0-prerelease.37 51 3/7/2024
0.4.0-prerelease.36 54 3/7/2024
0.4.0-prerelease.35 51 3/7/2024
0.4.0-prerelease.34 56 3/7/2024
0.4.0-prerelease.33 55 3/7/2024
0.4.0-prerelease.32 54 3/7/2024
0.4.0-prerelease.28 58 3/7/2024
0.4.0-prerelease.27 49 3/7/2024
0.4.0-prerelease.25 53 3/7/2024
0.4.0-prerelease.24 54 3/7/2024
0.4.0-prerelease.23 54 3/7/2024
0.4.0-prerelease.22 55 3/7/2024
0.4.0-prerelease.21 60 3/7/2024
0.4.0-prerelease.20 55 3/7/2024
0.4.0-prerelease.19 54 3/7/2024
0.4.0-prerelease.18 56 3/7/2024
0.4.0-prerelease.17 62 3/7/2024
0.4.0-prerelease.16 57 3/7/2024
0.4.0-prerelease.15 54 3/7/2024
0.4.0-prerelease.14 59 3/7/2024
0.4.0-prerelease.13 57 3/7/2024
0.3.0 121 3/5/2024
0.3.0-prerelease.3 62 3/5/2024
0.2.0 116 3/5/2024
0.1.0 133 3/5/2024
0.1.0-prerelease.22 60 3/5/2024
0.1.0-prerelease.19 53 3/5/2024
0.1.0-prerelease.18 58 3/5/2024
0.1.0-prerelease.17 57 3/5/2024
0.1.0-prerelease.13 65 3/5/2024
0.1.0-prerelease.12 66 3/5/2024
0.1.0-prerelease.10 65 3/5/2024
0.1.0-prerelease.9 64 3/5/2024
0.1.0-prerelease.8 61 3/5/2024
0.1.0-prerelease.7 63 3/5/2024
0.1.0-prerelease.5 63 3/5/2024
0.1.0-prerelease.4 57 3/5/2024
0.1.0-prerelease.3 62 3/5/2024
0.1.0-prerelease.2 58 3/5/2024
0.1.0-prerelease.1 147 12/13/2023
0.1.0-alpha.1 70 3/5/2024

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

## What's Changed
* Cleanups by @Kiryuumaru in https://github.com/Kiryuumaru/NukeBuildHelpers/pull/206
* Bump xunit.runner.visualstudio from 2.8.2 to 3.0.0 by @dependabot in https://github.com/Kiryuumaru/NukeBuildHelpers/pull/207

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