Table of Contents

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.

Basic Example

  1. Create a new file Build.cs

    #:package DecSm.Atom@2.*
    
    [BuildDefinition]
    [GenerateEntryPoint]
    partial class Build : BuildDefinition
    {
        Target SayHello => t => t
            .Executes(() => Logger.LogInformation("Hello, World!"));
    }
    
  2. Execute dotnet run Build.cs SayHello

    25-12-16 +10:00  DecSm.Atom.Build.BuildExecutor:
    22:46:01.754 INF Executing build
    
    SayHello
    
    25-12-16 +10:00  SayHello | Build:
    22:46:01.790 INF Hello, World!    
    
    Build Summary
    
      SayHello │ Succeeded │ <0.01s
    

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 SystemIAtomFileSystem, 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.