@startuml

folder "Linux Builds" as LinuxBuilds {
    ' Define the build tasks as business processes
    agent "DEB"  as BuildDEB
    agent "RPM"  as BuildRPM
    agent "Alpine"  as BuildAlpine
    agent "Linux-FxDependent"  as BuildLinuxFx

}

agent "macOS Build"  as BuildMac

agent "Upload build metadata" as BuildMetadata

folder "Windows Builds" as WinBuilds {
    agent "x64"  as BuildWinX64
    agent "x86"  as BuildWinX86
    agent "arm32"  as BuildWinArm32
    agent "arm64"  as BuildWinArm64
    agent "FxDependent"  as BuildWinFx
}

agent "ComponentRegistration"  as BuildCG

folder "Linux Package Scanning and Upload" as PkgScanUploadLinux {
    agent "DEB"  as UploadDEB
    agent "RPM"  as UploadRPM
    agent "Alpine"  as UploadAlpine
    agent "Linux-FxDependent"  as UploadLinuxFx
}

folder "Package Signing and Upload" as PkgSignUpload {
    agent "macOS"  as SignMac

    agent "Windows"  as SignWin
}

folder "Build Test Artifacts" as TestArtifacts {
    agent "Windows" as WinTest
    agent "Linux" as LinuxTest
    agent "Linux-ARM" as LinuxArmTest
    agent "Linux-ARM64" as LinuxArm64Test
}

agent "Compliance"  as Compliance


agent "Create SDK and Global Tool and Upload" as BuildNuGet


' Define finishing the build as a goal filled
control "Finish"  as Finish
control "Start" as Start

' map the various Upload task dependencies
BuildDEB -down-> UploadDEB
BuildRPM -down-> UploadRPM
BuildLinuxFx -down-> UploadLinuxFx
BuildAlpine -down-> UploadAlpine

' map all of the SignMac task dependencies
BuildMac -down-> SignMac

' map all of the SignWin task dependencies
WinBuilds -down-> SignWin
'BuildWinX64 -down-> SignWin
'BuildWinX86 -down-> SignWin
'BuildWinArm32 -down-> SignWin
'BuildWinArm64 -down-> SignWin
'BuildWinFx -down-> SignWin

' map all of the Compliance task dependencies
BuildWinX86 -down-> Compliance
BuildWinX64 -down-> Compliance
BuildWinFx -down-> Compliance

PkgSignUpload -down-> BuildNuGet
LinuxBuilds -down-> BuildNuGet

' map all leafs to finish
Compliance ~~ Finish
UploadAlpine ~~ Finish
UploadDEB ~~ Finish
UploadRPM ~~ Finish
UploadLinuxFx ~~ Finish
SignMac ~~ Finish
BuildCG ~~ Finish
BuildNuGet ~~ Finish
TestArtifacts ~~ Finish
BuildMetadata ~~ Finish

Start ~~ BuildDEB
Start ~~ BuildRPM
Start ~~ BuildAlpine
Start ~~ BuildLinuxFx
Start ~~ BuildMac
Start ~~ BuildWinX64
Start ~~ BuildWinX86
Start ~~ BuildWinFx
Start ~~ BuildWinArm32
Start ~~ BuildWinArm64
Start ~~ BuildCG
Start ~~ TestArtifacts
Start ~~ BuildMetadata

@enduml
