Skip to content

Commit

Permalink
CODE RUB: ADotNet Package Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdutoit committed Sep 6, 2023
1 parent 9ae5196 commit 19fe2ff
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 35 deletions.
80 changes: 46 additions & 34 deletions Standard.AI.OpenAI.Infrastructure.Build/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// ----------------------------------------------------------------------------------
// Copyright (c) The Standard Organization, a coalition of the Good-Hearted Engineers
// ----------------------------------------------------------------------------------
// Copyright (c) The Standard Organization: A coalition of the Good-Hearted Engineers
// ----------------------------------------------------------------------------------

using System.Collections.Generic;
using System.IO;
using ADotNet.Clients;
using ADotNet.Models.Pipelines.GithubPipelines.DotNets;
using ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks;
using ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks.SetupDotNetTaskV1s;
using ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks.SetupDotNetTaskV3s;

namespace Standard.AI.OpenAI.Infrastructure.Build
{
Expand Down Expand Up @@ -34,57 +35,68 @@ private static void Main(string[] args)
}
},

Jobs = new Jobs
Jobs = new Dictionary<string, Job>
{
Build = new BuildJob
{
EnvironmentVariables = new Dictionary<string, string>
"build",
new Job
{
{ "ApiKey", "${{ secrets.APIKEY }}" },
{ "OrgId", "${{ secrets.ORGID }}" }
},

RunsOn = BuildMachines.WindowsLatest,

Steps = new List<GithubTask>
{
new CheckoutTaskV2
EnvironmentVariables = new Dictionary<string, string>
{
Name = "Pulling Code"
{ "ApiKey", "${{ secrets.APIKEY }}" },
{ "OrgId", "${{ secrets.ORGID }}" }
},

new SetupDotNetTaskV1
RunsOn = BuildMachines.WindowsLatest,

Steps = new List<GithubTask>
{
Name = "Installing .NET",
new CheckoutTaskV3
{
Name = "Pulling Code"
},

TargetDotNetVersion = new TargetDotNetVersion
new SetupDotNetTaskV3
{
DotNetVersion = "7.0.201"
}
},
Name = "Installing .NET",

new RestoreTask
{
Name = "Restoring Packages"
},
With = new TargetDotNetVersionV3
{
DotNetVersion = "7.0.201"
}
},

new DotNetBuildTask
{
Name = "Building Solution"
},
new RestoreTask
{
Name = "Restoring Packages"
},

new TestTask
{
Name = "Running Tests"
new DotNetBuildTask
{
Name = "Building Solution"
},

new TestTask
{
Name = "Running Tests"
}
}
}
}
}
};

string buildScriptPath = "../../../../.github/workflows/dotnet.yml";
string directoryPath = Path.GetDirectoryName(buildScriptPath);

if (!Directory.Exists(directoryPath))
{
Directory.CreateDirectory(directoryPath);
}

adoNetClient.SerializeAndWriteToFile(
adoPipeline: githubPipeline,
path: "../../../../.github/workflows/dotnet.yml");
path: buildScriptPath);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ADotNet" Version="2.1.2" />
<PackageReference Include="ADotNet" Version="3.0.2" />
</ItemGroup>

</Project>

0 comments on commit 19fe2ff

Please sign in to comment.