cangulo.nuke.releasecreator
Problem I want to solveโ
Every time I want to release a new version in my C# projects, I have to do it manually or define a custom GH action for every repo. I would like to have a general solution that makes this automatically every time I merge a PR. Also, as I have been playing with NUKE lately, I want to include it in the solution.
NUKE is a build automation framework where you define operations as build, test or push NuGets, in a C# project. I found good reviews and some videos in Channel9 about it. So, for instance, dotnet commands are predefined methods, and its arguments are extension methods, check the next example:
How a NUKE project looks like?
Target Pack => _ => _
.DependsOn(Clean)
.Executes(() =>
{
DotNetTasks
.DotNetPack(s => s
.SetProject(project.Path)
.SetOutputDirectory(outputFolderAbsolutePath)
.SetConfiguration(configuration)
.SetVersionPrefix(currentPackageVersion)
.SetVersionSuffix(versionSuffix)
.EnableNoRestore());
});
Goalsโ
- Build a solution that releases a new version every time a PR is merged.
- The Solution should be based on NUKE.
- Any repository should be able to use it.
Approachโ
cangulo.nuke.releasecreator will execute the following operations sequentially:
- Calculate the next version based on the commits merged
- Release a new version through the GH API client (provided by NUKE).
Next are the requirements for calculating the release number:
- The repository app follows Semantic Versioning.
- All PR contain Conventional Commits which set the release to be created (major, minor or fix).
So, if an app has the version 0.0.2 and a PR with a fix commit as fix: solved error in the controller is merged, the version released will be 0.0.3.
Remarksโ
- I'm not saying NUKE is the best solution, I just want to give it a try ๐. In the future, I will create another solution based on scripts.
- As I started coding this, I realize that I can define more tasks as:
- To update the version in
.csprojfiles. I did this as optional. - To update the changelog using cangulo.changelog
- To push custom Assets to the release, like a JSON schema that we updated
- To update the version in
How to use it?โ
Please check the examples given here.
Where do I use it?โ
I call this solution through a specific GH Action in the next projects:
- cangulo-nugets/cangulo.changelog
- cangulo-nugets/cangulo.common.testing
- cangulo-nuke/cangulo.nuke.prcommitsvalidations
- cangulo-actions/cangulo.nuke.prcommitsvalidations
- cangulo-tf/basic-iac
Repositoryโ
solution cangulo.nuke.releasecreator
GitHub Actionโ
github action to execute in ANY repository
About meโ
I'm a Senior Platform Engineer. I build and evolve Internal Developer Platforms โ golden paths, self-service tooling, and paved roads spanning AWS governance, CI/CD standardization, and developer enablement โ so engineering teams ship faster, safer, and more autonomously, with less cognitive load. My core stack is AWS, Terraform, and GitHub Actions, and I'm an AWS Certified Solutions Architect. I care deeply about paved roads, productivity, and documenting implementations so knowledge scales with the team (yes, I'm an engineer who likes to document ๐งโ๐ป).
You can check my experience here.
Personal Blog - cangulo.github.io
GitHub - Carlos Angulo Mascarell - cangulo
LinkedIn - Carlos Angulo Mascarell