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 bc239a0 commit bb13e5f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 35 deletions.
79 changes: 45 additions & 34 deletions RESTFulSense.Infrastructure.Build/Program.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// ---------------------------------------------------------------
// Copyright (c) Hassan Habib
// Licensed under the MIT License.
// See License.txt in the project root for license information.
// ---------------------------------------------------------------
// ----------------------------------------------------------------------------------
// 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 RESTFulSense.Infrastructure.Build
{
Expand All @@ -35,50 +34,62 @@ static void Main(string[] args)
}
},

Jobs = new Jobs
Jobs = new Dictionary<string, Job>
{
Build = new BuildJob
{
RunsOn = BuildMachines.Windows2019,

Steps = new List<GithubTask>
"build",
new Job
{
new CheckoutTaskV2
{
Name = "Check Out"
},
RunsOn = BuildMachines.Windows2019,

new SetupDotNetTaskV1
Steps = new List<GithubTask>
{
Name = "Setup .Net",
new CheckoutTaskV3
{
Name = "Check Out"
},

TargetDotNetVersion = new TargetDotNetVersion
new SetupDotNetTaskV3
{
DotNetVersion = "6.0.101",
IncludePrerelease = true
}
},
Name = "Setup .Net",

new RestoreTask
{
Name = "Restore"
},
With = new TargetDotNetVersionV3
{
DotNetVersion = "6.0.101",
}
},

new DotNetBuildTask
{
Name = "Build"
},
new RestoreTask
{
Name = "Restore"
},

new TestTask
{
Name = "Test"
new DotNetBuildTask
{
Name = "Build"
},

new TestTask
{
Name = "Test"
}
}
}
}
}
};

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

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

adotNetClient.SerializeAndWriteToFile(
adoPipeline: githubPipeline,
path: buildScriptPath);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

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

</Project>

0 comments on commit bb13e5f

Please sign in to comment.