Gen (Generate Workflow Files)
Interface: IGen
Package: Invex.Atom.Workflows
The Gen target generates CI/CD configuration files from your workflow definitions.
What It Does
- Resolves each
WorkflowDefinitionin your build'sWorkflowsproperty. - Analyses the target dependency graph, artifact dependencies, and variable dependencies.
- Maps targets into jobs and creates a platform-neutral
WorkflowModel. - Invokes each registered
IWorkflowWriter(one per platform type) to render and write the YAML files.
Generated File Locations
| Platform | Output Directory |
|---|---|
| GitHub Actions | .github/workflows/ |
| Azure DevOps | .devops/workflows/ |
Usage
dotnet run --project _atom Gen
# or, with the atom global tool
atom Gen
Requirements
Your build must:
- Inherit from
WorkflowBuildDefinition(or implementIWorkflowBuildDefinition). - Override the
Workflowsproperty with at least one definition. - Inherit a platform module interface (
IGithubWorkflows,IDevopsWorkflows, or both) so the corresponding workflow writer is registered.
Automatic Generation & Outdated File Detection
You usually don't need to run Gen explicitly during local development: when the build runs in interactive
(non-headless) mode, the WorkflowLifecycleHook regenerates workflow files automatically before any targets execute.
When the build runs in headless mode (the --headless flag, typical in CI), files are not regenerated. Instead,
if the files on disk are out of date with the current definitions, the build fails early with a
WorkflowOutdatedException, prompting you to run the Gen target locally and commit the regenerated files.