Getting Started
Prerequisites
0. (Optional) Install the Atom Tool
dotnet tool install -g DecSm.Atom.Tool1. Set up the Build Definition
dotnet new worker -n _atomcd _atom dotnet add package DecSm.Atom dotnet add package DecSm.Atom.GithubWorkflows// _atom/Build.cs // The DecSm.Atom NuGet package provides global usings for most Atom types. // Mark this class as the build definition and generate an entry point [BuildDefinition] [GenerateEntryPoint] public partial class Build : BuildDefinition { // Define your targets Target MyCustomTarget => t => t .DescribedAs("My first custom Atom target.") .Executes(() => { Logger.LogInformation("Hello from MyCustomTarget!"); }); // Define your workflows here public override IReadOnlyList<WorkflowDefinition> Workflows => [ new("my-workflow") { // Defines the conditions under which the workflow should run Triggers = [ GitPushTrigger.ToMain, GitPullRequestTrigger.IntoMain, ], // Defines the targets that should be executed when the workflow runs Targets = [ // WorkflowTargets.* is a source-generated static class. // Atom automatically creates properties for each defined Target in your Build class, // allowing for convenient access and strong typing. WorkflowTargets.MyCustomTarget, ], // Generate workflows for GitHub Actions WorkflowTypes = [Github.WorkflowType], } ]; }
2. Run Your Build
3. Generate CI/CD Workflows
Next Steps
Last updated
Was this helpful?
