From 99f0ad5ada709dead8b25473eeadd8ca0a0bd12b Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Mon, 15 Apr 2024 23:58:14 -0700 Subject: [PATCH] (#144) Ensure artifact upload is the last action WIthin the CopyBuildOutput method, when it is a Web Application that is being built, the MSBuild.log file is used again to capture some additional output. This means that there will sometimes be a change to the file, and therefore the artitfact upload can't be completed. By moving the upload to be the last thing that is done in the task, it should be able to complete successfully. --- Chocolatey.Cake.Recipe/Content/build.cake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Chocolatey.Cake.Recipe/Content/build.cake b/Chocolatey.Cake.Recipe/Content/build.cake index ac789a0..0c17ad3 100644 --- a/Chocolatey.Cake.Recipe/Content/build.cake +++ b/Chocolatey.Cake.Recipe/Content/build.cake @@ -168,12 +168,12 @@ BuildParameters.Tasks.BuildTask = Task("Build") XBuild(BuildParameters.SolutionFilePath, xbuildSettings); } + CopyBuildOutput(); + if (FileExists(BuildParameters.Paths.Files.BuildLogFilePath)) { BuildParameters.BuildProvider.UploadArtifact(BuildParameters.Paths.Files.BuildLogFilePath); } - - CopyBuildOutput(); })); BuildParameters.Tasks.DotNetBuildTask = Task("DotNetBuild")