From ae6389aba9b0678aacc7c27f46fbce7dc779cc42 Mon Sep 17 00:00:00 2001 From: Florian Rappl Date: Sat, 23 Dec 2023 14:52:27 +0100 Subject: [PATCH] Fresh build --- .../tasks/PublishPiletTask.cs | 33 ++----------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/src/Piral.Blazor.Tools/tasks/PublishPiletTask.cs b/src/Piral.Blazor.Tools/tasks/PublishPiletTask.cs index 09cdffd..17ab922 100644 --- a/src/Piral.Blazor.Tools/tasks/PublishPiletTask.cs +++ b/src/Piral.Blazor.Tools/tasks/PublishPiletTask.cs @@ -105,33 +105,9 @@ private void RunPublish() Directory.Delete(outdir, true); } - // Build the pilet - RunPiralCli(target, $"pilet build"); - - // Replace with files from publish - // -- ignored for now as published artifacts might behave weird: - // -- https://github.com/smapiot/Piral.Blazor/issues/128 - // CompareAndReplace(outdir, root); - - // Pack and publish - RunPiralCli(target, $"pilet pack"); - RunPiralCli(target, $"pilet publish --url {FeedUrl} {auth}"); - } - } - - private void CompareAndReplace(string outdir, string root) - { - var files = Directory.GetFiles(outdir, "*", SearchOption.AllDirectories); - - foreach (var file in files) - { - var relName = file.Replace(outdir, ""); - var newName = root + relName; - - if (File.Exists(newName)) - { - File.Copy(newName, file, true); - } + // Publish with a fresh build to prevent weird behavior as in + // https://github.com/smapiot/Piral.Blazor/issues/128 + RunPiralCli(target, $"pilet publish --fresh --url {FeedUrl} {auth}"); } } @@ -150,9 +126,6 @@ private void RunPiralCli(string cwd, string arguments) RedirectStandardOutput = true, }; - // Prevents running dotnet build unnecessarily - startInfo.EnvironmentVariables["PIRAL_BLAZOR_LAST_BUILD"] = "1"; - var proc = new Process { StartInfo = startInfo,