NukeBuildTemplate is a project template repository for setting up build automation using NukeBuild. This template is designed to work seamlessly with GitHub Actions and Azure Pipelines, allowing for efficient CI/CD and release management across multiple projects and environments within a single repository.
NuGet
Name | Info |
---|---|
NukeBuildHelpers |
- 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.
-
Create a New Repository from Template
Simply visit the NukeBuildTemplate repository on GitHub and click the
Use this template
button. -
Clone the Repository
git clone https://github.com/<your-username>/<your-repo>.git cd <your-repo>
-
Define Environment Branches
class Build : BaseNukeBuildHelpers { ... public override string[] EnvironmentBranches { get; } = [ "prerelease", "master" ]; public override string MainEnvironmentBranch { get; } = "master"; }
-
Create custom build flows, implement any of the target entries
TestEntry
,BuildEntry
orPublishEntry
.class Build : BaseNukeBuildHelpers { ... TestEntry TestEntry => _ => _ .AppId("sample_app") .RunnerOS(RunnerOS.Ubuntu2204) .Execute(() => { // test logic here }); BuildEntry BuildEntry => _ => _ .AppId("sample_app") .RunnerOS(RunnerOS.Windows2022) .Execute(() => { // build logic here }); PublishEntry PublishEntry => _ => _ .AppId("sample_app") .RunnerOS(RunnerOS.Ubuntu2204) .Execute(context => { // publish logic here }); }
See documentation for TestEntry, BuildEntry and PublishEntry
-
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.
-
Use the
build bump
command to interactively bump the project version:build bump
-
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.
For more information, visit the NukeBuildHelpers repository.
This project is licensed under the MIT License - see the LICENSE file for details.
- NukeBuild for providing the foundation for this project.