Skip to content

Commit

Permalink
Add Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Oct 10, 2024
1 parent fbf2a05 commit 7bb9a2f
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions build/DeployTasks/UploadArtifactsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,27 @@ public override async Task RunAsync(BuildContext context)

// Clean up build tools if installed
// otherwise we get permission issues after extraction
var path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release", "osx");
DeleteToolStore (path);
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release", "linux");
DeleteToolStore (path);
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release");
DeleteToolStore (path);
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release", "tools");
System.IO.Directory.Delete (path, recursive: true);
var path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release", "tools");
if (System.IO.Directory.Exists(path)) {
context.Log.Information ($"Deleting: {path}");
System.IO.Directory.Delete (path, recursive: true);
}
if (context.IsRunningOnMacOs())
{
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release", "osx");
DeleteToolStore (context, path);
}
if (context.IsRunningOnLinux())
{
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release", "linux");
DeleteToolStore (context, path);
}
if (context.IsRunningOnWindows())
{
path = System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release");
DeleteToolStore (context, path);
}


await context.GitHubActions().Commands.UploadArtifact(new DirectoryPath(context.NuGetsDirectory.FullPath), $"nuget-{os}");
await context.GitHubActions().Commands.UploadArtifact(new DirectoryPath(System.IO.Path.Combine(context.BuildOutput, "Tests", "Tools", "Release")), $"tests-tools-{os}");
Expand All @@ -33,13 +46,15 @@ public override async Task RunAsync(BuildContext context)
await context.GitHubActions().Commands.UploadArtifact(new DirectoryPath(System.IO.Path.Combine(context.BuildOutput, "Tests", "WindowsDX", "Release")), $"tests-windowsdx-{os}");
}

void DeleteToolStore (string path)
void DeleteToolStore (BuildContext context, string path)
{
if (System.IO.Directory.Exists (path)) {
var store = System.IO.Path.Combine (path, ".store");
if (System.IO.Directory.Exists (store)) {
context.Log.Information ($"Deleting: {store}");
System.IO.Directory.Delete (store, recursive: true);
foreach (var file in System.IO.Directory.GetFiles (path, "mgcb-*", System.IO.SearchOption.TopDirectoryOnly)) {
context.Log.Information ($"Deleting: {file}");
System.IO.File.Delete (file);
}
}
Expand Down

0 comments on commit 7bb9a2f

Please sign in to comment.