Invex.Atom.Module.GithubWorkflows 3.1.0-rc.4

This is a prerelease version of Invex.Atom.Module.GithubWorkflows.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Invex.Atom.Module.GithubWorkflows --version 3.1.0-rc.4
                    
NuGet\Install-Package Invex.Atom.Module.GithubWorkflows -Version 3.1.0-rc.4
                    
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="Invex.Atom.Module.GithubWorkflows" Version="3.1.0-rc.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Invex.Atom.Module.GithubWorkflows" Version="3.1.0-rc.4" />
                    
Directory.Packages.props
<PackageReference Include="Invex.Atom.Module.GithubWorkflows" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Invex.Atom.Module.GithubWorkflows --version 3.1.0-rc.4
                    
#r "nuget: Invex.Atom.Module.GithubWorkflows, 3.1.0-rc.4"
                    
#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.
#:package Invex.Atom.Module.GithubWorkflows@3.1.0-rc.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Invex.Atom.Module.GithubWorkflows&version=3.1.0-rc.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Invex.Atom.Module.GithubWorkflows&version=3.1.0-rc.4&prerelease
                    
Install as a Cake Tool

Atom

Validate Build Dependabot Updates

Atom is an opinionated, type-safe build automation framework for .NET. It enables you to define your build logic in C#, debug it like standard code, and automatically generate CI/CD configuration files for GitHub Actions and Azure DevOps.

Why Atom?

Zero Context Switching

Write build logic in C# alongside your application code.

Intellisense & Debugging

Step through your build process using your IDE.

CI/CD Agnostic

Define logic once; Atom generates the YAML for GitHub and Azure DevOps.

Modular

Pull in capabilities via NuGet packages (GitVersion, Azure KeyVault, etc.).

Source Generators

Reduces boilerplate by automatically discovering targets and parameters.

Examples

Hello World

It is recommended to use the atom dotnet tool to invoke atom projects:

dotnet tool install -g Invex.Atom.Tool

atom ...

However, the dotnet cli can also be used directly:

dotnet run -- ...

  1. Create a .NET 10 project

    dotnet new console -n _atom
    
  2. Update the _atom.csproj file:

    <Project Sdk="Microsoft.NET.Sdk.Worker">
    
      <PropertyGroup>
        <TargetFramework>net10.0</TargetFramework>
        <RootNamespace>Atom</RootNamespace>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Invex.Atom.Build" Version="3.*" />
      </ItemGroup>
    
    </Project>
    
  3. Replace the Program.cs file with IBuild.cs:

    using Invex.Atom.Build.Definition;
    using Invex.Atom.Build.Hosting;
    
    namespace Atom;
    
    [BuildDefinition]
    [GenerateEntryPoint]
    internal interface IBuild : IBuildDefinition
    {
        Target HelloWorld =>
            t => t
            .DescribedAs("Prints a hello world message to the console")
            .Executes(() => Logger.LogInformation("Hello, World!"));
    }
    
  4. Execute atom HelloWorld

    26-06-06 +10:00  Invex.Atom.Build.BuildExecutor:
    01:16:47.552 INF Executing build
    
    HelloWorld
    
    Prints a hello world message to the console
    
    26-06-06 +10:00  HelloWorld | Atom.Build:      
    01:16:47.616 INF Hello, World!
    
    
    Build Summary
    
    HelloWorld │ Succeeded │ <0.01s
    

Adding Params

  1. Add a parameter to the IBuild interface:

    .RequiresParam(nameof(...)) is used to ensure the parameter is provided before the target is executed.

    .UsesParam(nameof(...)) is used to use the parameter if it is provided, but not fail the build if it is not.

    using Invex.Atom.Build.Definition;
    using Invex.Atom.Build.Hosting;
    using Invex.Atom.Build.Params;
    
    namespace Atom;
    
    [BuildDefinition]
    [GenerateEntryPoint]
    internal interface IBuild : IBuildDefinition
    {
        [ParamDefinition("my-name", "My name")]
        string? MyName => GetParam(() => MyName);
    
        Target HelloWorld =>
            t => t
                .DescribedAs("Prints a hello world message to the console")
                .RequiresParam(nameof(MyName))
                .Executes(() => Logger.LogInformation("Hello, World! I am {MyName}.", MyName));
    }
    
  2. Execute `atom HelloWorld --my-name Frodo

    26-06-06 +10:00  Invex.Atom.Build.BuildExecutor:
    01:23:25.405 INF Executing build
    
    HelloWorld
    
    Prints a hello world message to the console
    
    26-06-06 +10:00  HelloWorld | Atom.Build:
    01:23:25.467 INF Hello, World! I am Frodo.
    
    
    Build Summary
    
      HelloWorld │ Succeeded │ <0.01s
    

Adding Secrets

  1. Add a secret parameter to the IBuild interface:

    using Invex.Atom.Build.Definition;
    using Invex.Atom.Build.Hosting;
    using Invex.Atom.Build.Params;
    
    namespace Atom;
    
    [BuildDefinition]
    [GenerateEntryPoint]
    internal interface IBuild : IBuildDefinition
    {
        [ParamDefinition("my-name", "My name")]
        string? MyName => GetParam(() => MyName);
    
        [SecretDefinition("my-secret", "My secret")]
        string? MySecret => GetParam(() => MySecret);
    
        Target HelloWorld =>
            t => t
                .DescribedAs("Prints a hello world message to the console")
                .RequiresParam(nameof(MyName))
                .RequiresParam(nameof(MySecret))
                .Executes(() =>
                    Logger.LogInformation("Hello, World! I am {MyName} and my secret is {MySecret}.",
                        MyName,
                        MySecret));
    }
    
  2. Execute atom HelloWorld --my-name Frodo --my-secret TheOneRing

    The secret is masked in the output.

    26-06-06 +10:00  Invex.Atom.Build.BuildExecutor:
    01:27:08.482 INF Executing build                
    
    HelloWorld
    
    Prints a hello world message to the console
    
    26-06-06 +10:00  HelloWorld | Atom.Build:                        
    01:27:08.544 INF Hello, World! I am Frodo and my secret is *****.
    
    
    Build Summary
    
      HelloWorld │ Succeeded │ <0.01s
    

Adding Target Dependencies

  1. Update the IBuild interface:

    using Invex.Atom.Build.Definition;
    using Invex.Atom.Build.Hosting;
    using Invex.Atom.Build.Params;
    
    namespace Atom;
    
    [BuildDefinition]
    [GenerateEntryPoint]
    internal interface IBuild : IBuildDefinition
    {
        [ParamDefinition("my-name", "My name")]
        string? MyName => GetParam(() => MyName);
    
        [SecretDefinition("my-secret", "My secret")]
        string? MySecret => GetParam(() => MySecret);
    
        Target HelloWorld =>
            t => t
                .DescribedAs("Prints a hello world message to the console")
                .RequiresParam(nameof(MyName))
                .RequiresParam(nameof(MySecret))
                .Executes(() =>
                    Logger.LogInformation("Hello, World! I am {MyName} and my secret is {MySecret}.", MyName, MySecret));
    
        Target Goodbye =>
            t => t
                .DescribedAs("Prints a goodbye message to the console")
                .DependsOn(nameof(HelloWorld))
                .Executes(() => Logger.LogInformation("Goodbye!"));
    }
    
  2. Execute atom Goodbye --my-name Frodo --my-secret TheOneRing

    The Goodbye target depends on the HelloWorld target, so both will be executed in the correct order, and the parameters only need to be provided once.

    26-06-06 +10:00  Invex.Atom.Build.BuildExecutor:
    01:30:12.175 INF Executing build                
    
    HelloWorld
    
    Prints a hello world message to the console
    
    26-06-06 +10:00  HelloWorld | Atom.Build:                        
    01:30:12.235 INF Hello, World! I am Frodo and my secret is *****.
    
    Goodbye
    
    Prints a goodbye message to the console
    
    26-06-06 +10:00  Goodbye | Atom.Build:
    01:30:12.240 INF Goodbye!             
    
    
    Build Summary
    
      HelloWorld │ Succeeded │ <0.01s    
      Goodbye    │ Succeeded │ <0.01s
    

Adding Workflow Generation

  1. Update the _atom.csproj file:

    <Project Sdk="Microsoft.NET.Sdk.Worker">
    
      <PropertyGroup>
        <TargetFramework>net10.0</TargetFramework>
        <RootNamespace>Atom</RootNamespace>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Invex.Atom.Module.GithubWorkflows" Version="3.*" />
      </ItemGroup>
    
    </Project>
    
  2. Update the IBuild interface:

    using Invex.Atom.Build.BuildOptions;
    using Invex.Atom.Build.Definition;
    using Invex.Atom.Build.Hosting;
    using Invex.Atom.Build.Params;
    using Invex.Atom.Module.GithubWorkflows.Extensions;
    using Invex.Atom.Module.GithubWorkflows.Helpers;
    using Invex.Atom.Workflows;
    using Invex.Atom.Workflows.Definition;
    using Invex.Atom.Workflows.Definition.Triggers;
    using Invex.Atom.Workflows.Options;
    using Invex.StructuredText.Expressions;
    
    namespace Atom;
    
    [BuildDefinition]
    [GenerateEntryPoint]
    internal interface IBuild : IWorkflowBuildDefinition, IGithubWorkflows
    {
    [ParamDefinition("my-name", "My name")]
    string? MyName => GetParam(() => MyName);
    
        [SecretDefinition("my-secret", "My secret")]
        string? MySecret => GetParam(() => MySecret);
    
        Target HelloWorld =>
            t => t
                .DescribedAs("Prints a hello world message to the console")
                .RequiresParam(nameof(MyName))
                .RequiresParam(nameof(MySecret))
                .Executes(() =>
                    Logger.LogInformation("Hello, World! I am {MyName} and my secret is {MySecret}.", MyName, MySecret));
    
        Target Goodbye =>
            t => t
                .DescribedAs("Prints a goodbye message to the console")
                .DependsOn(nameof(HelloWorld))
                .Executes(() => Logger.LogInformation("Goodbye!"));
    
        IReadOnlyList<WorkflowDefinition> IWorkflowBuildDefinition.Workflows =>
        [
            new("Hello")
            {
                Triggers = [WorkflowTriggers.PushToMain],
                Targets =
                [
                    new(nameof(HelloWorld))
                    {
                        Options =
                        [
                            BuildOptions.Inject.Param(nameof(MyName), TextExpressions.Github.GithubRepositoryOwner),
                            BuildOptions.Inject.Secret(nameof(MySecret)),
                        ],
                    },
                    new(nameof(Goodbye)),
                ],
                Types = [WorkflowTypes.Github.Action],
            },
        ];
    }
    
  3. Execute atom gen

    26-06-06 +10:00  Invex.Atom.Module.GithubWorkflows.GithubActions.GithubWorkflowFileWriter:                                               
    01:38:57.388 INF Writing new workflow file:                                  
                     L:\Repos\Invex-Games\atom\.github\workflows\Hello.yml             
    
    
    26-06-06 +10:00  Invex.Atom.Build.BuildExecutor:
    01:38:57.472 INF Executing build                
    
    Gen
    
    Generates workflow files
    
    
    Build Summary
    
      Gen    │ Succeeded │ <0.01s
    

    .github/workflows/Hello.yml

    name: Hello
    
    on:
      push:
        branches: [ main ]
    
    permissions: { }
    
    jobs:
    
      HelloWorld:
        runs-on: ubuntu-latest
        steps:
    
          - name: Checkout
            uses: actions/checkout@v6
            with:
              fetch-depth: 0
    
          - name: HelloWorld
            id: HelloWorld
            run: dotnet run --project _atom/_atom.csproj -- HelloWorld --skip --headless
            env:
              my-secret: ${{ secrets.MY_SECRET }}
              my-name: ${{ github.repository_owner }}
    
      Goodbye:
        needs: [ HelloWorld ]
        runs-on: ubuntu-latest
        steps:
    
          - name: Checkout
            uses: actions/checkout@v6
            with:
              fetch-depth: 0
    
          - name: Goodbye
            id: Goodbye
            run: dotnet run --project _atom/_atom.csproj -- Goodbye --skip --headless
    

File-based Apps

Atom can also be used as a file-based app:

Atom.cs

#:sdk Microsoft.NET.Sdk.Worker
#:package Invex.Atom.Build@3.*

using Invex.Atom.Build.Definition;
using Invex.Atom.Build.Hosting;

namespace Atom;

[BuildDefinition]
[GenerateEntryPoint]
internal interface IBuild : IBuildDefinition
{
    Target HelloWorld =>
        t => t
            .DescribedAs("Prints a hello world message to the console")
            .Executes(() => Logger.LogInformation("Hello, World!"));
}

Documentation

Getting Started

Core Concepts

  • Build Definitions — The [BuildDefinition] attribute and source generators
  • Targets — Defining targets with the fluent TargetDefinition API
  • Parameters — Declaring, requiring, and resolving parameters
  • Secrets — Secure parameter handling with ISecretsProvider
  • Artifacts — Producing and consuming build artifacts
  • Variables — Sharing data between targets with workflow variables
  • File SystemIRootedFileSystem, RootedPath, and path providers
  • Process Runner — Executing external processes
  • Build Info — Build ID, version, and timestamp providers
  • Build Options — Configuring build behaviour with IBuildOption
  • HostingAtomHost, [GenerateEntryPoint], and host configuration
  • Lifecycle HooksIAtomLifecycleHook for pre/post-build logic
  • Logging & Reports — Spectre console output and report data
  • File Transformations — Temporary, reversible file edits with TransformFileScope

Workflows

Modules

Built-in Targets

Developer Guide

Reference

  • CLI — Command-line arguments and the Atom global tool
  • API Reference — Auto-generated API documentation (via DocFX)

AI Disclaimer

The Atom libraries are human-made, however GitHub Copilot completions have been used on a superficial level.

Generative AI was also used to assist in writing tests and documentation.

License

Atom is released under the MIT License.

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.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Invex.Atom.Module.GithubWorkflows:

Package Downloads
Invex.RepoUtils.Atom.Module

A collection of .NET utilities for building and maintaining .NET repositories

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.0 37 6/13/2026
3.1.0-rc.15 42 6/12/2026
3.1.0-rc.10 37 6/12/2026
3.1.0-rc.8 36 6/11/2026
3.1.0-rc.4 41 6/10/2026
3.0.0 1,231 6/9/2026
3.0.0-rc.201 49 6/8/2026
3.0.0-beta.feature-v-next.200 49 6/8/2026
3.0.0-beta.feature-v-next.194 51 6/8/2026
3.0.0-beta.feature-v-next.193 41 6/8/2026
3.0.0-beta.feature-v-next.191 47 6/8/2026