Automatron 0.0.0-alpha.9

This is a prerelease version of Automatron.
There is a newer prerelease version of this package available.
See the version list below for details.

Requires NuGet 5.9 or higher.

dotnet add package Automatron --version 0.0.0-alpha.9                
NuGet\Install-Package Automatron -Version 0.0.0-alpha.9                
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="Automatron" Version="0.0.0-alpha.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Automatron --version 0.0.0-alpha.9                
#r "nuget: Automatron, 0.0.0-alpha.9"                
#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.
// Install Automatron as a Cake Addin
#addin nuget:?package=Automatron&version=0.0.0-alpha.9&prerelease

// Install Automatron as a Cake Tool
#tool nuget:?package=Automatron&version=0.0.0-alpha.9&prerelease                

Automatron

Build status

The Automatron Platform is a collection of .NET libraries to help .Net Developers create automation workloads in the in the same language as your .Net applications

Platform support: .NET 6.0 and later.

Tasks

NuGet version (Automatron.Tasks)

The Automatron.Tasks .NET library is a task automation system that enables you to write task based workflows as .Net methods

Tasks can be are defined as void/async methods on one or many classes

Inheritance and interfaces are supported as well

Tasks Quick start

  • Create a .NET console app named Sample and add a reference to Automatron.Tasks.
  • Replace the contents in Program.cs with:
using Automatron.Tasks;
using Automatron.Tasks.Annotations;

return await new TaskRunner().RunAsync(args);

namespace Sample;

public class Build
{
    [Task(Default = true)]
    public void Default()
    {
        Console.WriteLine("Hello, world!");
    }

    [Task]
    public void Build()
    {
        Console.WriteLine("Building my app");
    }
}
  • Run the app. E.g. dotnet run or F5 in Visual Studio:

Tasks can be run via cmd arguments dotnet run -- Build

Tasks Dependencies

Dependencies are expression via the attributes

  • DependentOn
  • DependentFor
using Automatron.Tasks;
using Automatron.Tasks.Annotations;

return await new TaskRunner().RunAsync(args);

namespace Sample;

public class Build
{
    [Task(Default = true)]
    [DependentOn(nameof(Build))]
    public void Default()
    {
        Console.WriteLine("Hello, world!");
    }

    [Task]
    public void Build()
    {
        Console.WriteLine("Building my app");
    }
}

Tasks Parameters

AzureDevOps

NuGet version (Automatron.AzureDevOps)

The Automatron.AzureDevOps .NET library enables you to write AzureDevOps workflows as .Net methods

Automatron.AzureDevOps also generates the AzureDevOps pipeline yaml every time the project is compiled.

Steps can be are defined as void/async methods on one or many job classes

Inheritance and interfaces are supported as well

AzureDevOps Quick start

The project needs to be in git repository to able to compute paths correctly or have the RootDir property set

using System.Reflection;
using Automatron.AzureDevOps;
using Automatron.AzureDevOps.Annotations;
using Automatron.AzureDevOps.Tasks;

return await new AzureDevOpsRunner().RunAsync(args);

[Pipeline("Ci")]
[CiTrigger(Batch = true, IncludeBranches = new[] { "main" }, IncludePaths = new[] { "src" })]
[Pool(VmImage = "ubuntu-latest")]
[Stage]
[Job]
public class Pipeline
{
    [Step(Emoji = "๐Ÿ—"]
    public async Task Build()
    {
    }

    [Step(Emoji = "๐Ÿงช", DependsOn = new[] { nameof(Build) })]
    public async Task Test()
    {
    }

    [Step(Emoji = "๐Ÿ“ฆ", DependsOn = new[] { nameof(Test) })]
    public async Task Pack()
    {
    }
}

Pipelines, Stage, Jobs, Steps can be run via cmd arguments dotnet run -- Ci

AzureDevOps Variables

Variables can mapped as properties

using System.Reflection;
using Automatron.AzureDevOps;
using Automatron.AzureDevOps.Annotations;
using Automatron.AzureDevOps.Tasks;

return await new AzureDevOpsRunner().RunAsync(args);

[Pipeline("Ci")]
[CiTrigger(Batch = true, IncludeBranches = new[] { "main" }, IncludePaths = new[] { "src" })]
[Pool(VmImage = "ubuntu-latest")]
[VariableGroup("nuget")]
[Stage]
[Job]
public class Pipeline
{
    [Variable(Description = "The nuget api key")]
    public Secret? NugetApiKey { get; set; }

    [Step(Emoji = "๐Ÿ—"]
    public async Task Build()
    {
    }

    [Step(Emoji = "๐Ÿงช", DependsOn = new[] { nameof(Build) })]
    public async Task Test()
    {
    }

    [Step(Emoji = "๐Ÿ“ฆ", DependsOn = new[] { nameof(Test) })]
    public async Task Pack()
    {
    }
}

AzureDevOps Parameters

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Automatron:

Package Downloads
Automatron.AzureDevOps

The Automatron.AzureDevOps .NET library enables you to write AzureDevOps workflows as .Net methods

Automatron.Tasks

The Automatron.Tasks .NET library is a task automation system that enables you to write task based workflows as .Net methods

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.0-alpha-11.6 596 11/2/2024
0.0.0-alpha-11.5 195 10/12/2024
0.0.0-alpha-11.4 50 10/12/2024
0.0.0-alpha-11.3 61 10/6/2024
0.0.0-alpha-11.2 84 10/1/2024
0.0.0-alpha-11 185 6/2/2023
0.0.0-alpha.10 125 1/6/2023
0.0.0-alpha.9 109 1/2/2023
0.0.0-alpha.8 110 11/23/2022
0.0.0-alpha.7 101 11/21/2022
0.0.0-alpha.6 106 11/16/2022
0.0.0-alpha.4 109 11/15/2022
0.0.0-alpha.3 100 11/15/2022
0.0.0-alpha.2 106 11/11/2022
0.0.0-alpha.1 102 11/10/2022