From 28e28453ebc700b3dc43efe919b8190d6048f81e Mon Sep 17 00:00:00 2001 From: Doug Slater Date: Sat, 16 Nov 2024 10:34:30 -0500 Subject: [PATCH 1/4] Migrate app to Velopack. Still support Squirrel --- Ui/FitEdit.Ui.Desktop/Program.cs | 2 +- Ui/FitEdit.Ui.Desktop/SquirrelAutoUpdater.cs | 1 + Ui/FitEdit.Ui.Desktop/VelopackAutoUpdater.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Ui/FitEdit.Ui.Desktop/SquirrelAutoUpdater.cs diff --git a/Ui/FitEdit.Ui.Desktop/Program.cs b/Ui/FitEdit.Ui.Desktop/Program.cs index 2f87277..2a66b32 100644 --- a/Ui/FitEdit.Ui.Desktop/Program.cs +++ b/Ui/FitEdit.Ui.Desktop/Program.cs @@ -32,4 +32,4 @@ public static AppBuilder BuildAvaloniaApp() .UsePlatformDetect() .LogToTrace() .UseReactiveUI(); -} \ No newline at end of file +} diff --git a/Ui/FitEdit.Ui.Desktop/SquirrelAutoUpdater.cs b/Ui/FitEdit.Ui.Desktop/SquirrelAutoUpdater.cs new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/Ui/FitEdit.Ui.Desktop/SquirrelAutoUpdater.cs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Ui/FitEdit.Ui.Desktop/VelopackAutoUpdater.cs b/Ui/FitEdit.Ui.Desktop/VelopackAutoUpdater.cs index 039ecfe..b2b99c5 100644 --- a/Ui/FitEdit.Ui.Desktop/VelopackAutoUpdater.cs +++ b/Ui/FitEdit.Ui.Desktop/VelopackAutoUpdater.cs @@ -55,4 +55,4 @@ private async Task CheckForUpdates(CancellationToken ct = default) Log.Error($"Problem checking or applying updates: {e}"); } } -} \ No newline at end of file +} From f0353e0bdcc4a76088d2300d4b2b531dca55df63 Mon Sep 17 00:00:00 2001 From: Doug Slater Date: Sun, 17 Nov 2024 09:17:23 -0500 Subject: [PATCH 2/4] Add Windows arm build --- .../FitEdit.Ui.Desktop.csproj | 23 ----- Ui/FitEdit.Ui.Desktop/create-release-win.ps1 | 84 +++++++++++++++---- 2 files changed, 66 insertions(+), 41 deletions(-) diff --git a/Ui/FitEdit.Ui.Desktop/FitEdit.Ui.Desktop.csproj b/Ui/FitEdit.Ui.Desktop/FitEdit.Ui.Desktop.csproj index 5159172..857188d 100644 --- a/Ui/FitEdit.Ui.Desktop/FitEdit.Ui.Desktop.csproj +++ b/Ui/FitEdit.Ui.Desktop/FitEdit.Ui.Desktop.csproj @@ -30,33 +30,10 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Ui/FitEdit.Ui.Desktop/create-release-win.ps1 b/Ui/FitEdit.Ui.Desktop/create-release-win.ps1 index 89edfd6..00112f5 100644 --- a/Ui/FitEdit.Ui.Desktop/create-release-win.ps1 +++ b/Ui/FitEdit.Ui.Desktop/create-release-win.ps1 @@ -20,29 +20,77 @@ pushd $PSScriptRoot $certTmpPath = "$PSScriptRoot/$certTmpPath" echo "Created $certTmpPath..." -echo "Publishing..." -dotnet publish FitEdit.Ui.Desktop.csproj --configuration $configuration --runtime $rid --framework $framework --output "./bin/Release/$framework/publish/$rid/" --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false - -echo "Packing..." - -vpk pack -y ` - --packId $packId ` - --packTitle "FitEdit" ` - --packAuthors $authors ` - --packVersion $version ` - --packDir "./bin/$configuration/$framework/publish/$rid/" ` - --icon "../FitEdit.Ui/Assets/logo.ico" ` - --mainExe "FitEdit.exe" ` - --outputDir "./Releases/$rid" ` - --delta None ` - --signParams="/f `"$certTmpPath`" /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com /csp `"$csp`" /k $certKey" +$jobs = @() +$rids = @("win-x64", "win-arm64") + +# dotnet does not support publishing multiple RIDs in parallel +# Attempting to results in either +# project.assets.json doesn't have a target for +'net8.0-macos/osx-x64' +# or +# project.assets.json doesn't have a target for +'net8.0-macos/osx-arm64' +# depending on which built first +# +# https://github.com/dotnet/sdk/issues/9363 +foreach ($rid in $rids) { + + echo "Publishing $rid..." + dotnet publish FitEdit.Ui.Desktop.csproj ` + --configuration $configuration ` + --runtime $rid ` + --framework $framework ` + --output "./bin/$configuration/$framework/publish/$rid/" ` + --self-contained true ` + -p:PublishSingleFile=true ` + -p:PublishTrimmed=false + + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } +} + +foreach ($rid in $rids) { + echo "Packing $rid..." + $job = Start-ThreadJob { + # Create thread-local copies of these variables + $packId = $using:packId + $authors = $using:authors + $version = $using:version + $configuration = $using:configuration + $framework = $using:framework + $rid = $using:rid + + & { + vpk pack -y ` + --packId $packId ` + --packTitle "FitEdit" ` + --packAuthors $authors ` + --packVersion $version ` + --packDir "./bin/$configuration/$framework/publish/$rid/" ` + --icon "../FitEdit.Ui/Assets/logo.ico" ` + --mainExe "FitEdit.exe" ` + --outputDir "./Releases/$rid" ` + --delta None ` + --signParams="/f `"$certTmpPath`" /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com /csp `"$csp`" /k $certKey" + + # Redirect all output (including stdout and stderr) to the main thread + # so it appears in the console and in CI build logs + } *>&1 | ForEach-Object { "[$rid] $_" } | Out-Host + + } -StreamingHost $Host + + # Add the job to the list + $jobs += $job +} + +# Wait for all jobs to complete +Wait-Job -Job $jobs Remove-Item -Path $certTmpPath $doSync = [System.Boolean]::Parse($sync) if ($doSync -ne $true) { - popd - return + popd + return } # Sync with s3 From a3265e03dedd426690074b42116cf1f1ba42067f Mon Sep 17 00:00:00 2001 From: Doug Slater Date: Sun, 17 Nov 2024 09:18:07 -0500 Subject: [PATCH 3/4] Bump version --- Directory.Build.props | 2 +- Ui/FitEdit.Ui.iOS/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 8d7ffc0..cc59625 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,7 +9,7 @@ disable latest - 5.7.2 + 5.7.3 45 FitEdit diff --git a/Ui/FitEdit.Ui.iOS/Info.plist b/Ui/FitEdit.Ui.iOS/Info.plist index e514c84..c9f929e 100644 --- a/Ui/FitEdit.Ui.iOS/Info.plist +++ b/Ui/FitEdit.Ui.iOS/Info.plist @@ -7,7 +7,7 @@ CFBundleIdentifier com.endurabyte.fitedit CFBundleShortVersionString - 5.7.2 + 5.7.3 LSRequiresIPhoneOS MinimumOSVersion From 7638eddf1d42d221796e84e0c39048a489da03f3 Mon Sep 17 00:00:00 2001 From: Doug Slater Date: Sun, 17 Nov 2024 09:30:32 -0500 Subject: [PATCH 4/4] Pass sign params to thread --- Ui/FitEdit.Ui.Desktop/create-release-win.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Ui/FitEdit.Ui.Desktop/create-release-win.ps1 b/Ui/FitEdit.Ui.Desktop/create-release-win.ps1 index 00112f5..1bb8b29 100644 --- a/Ui/FitEdit.Ui.Desktop/create-release-win.ps1 +++ b/Ui/FitEdit.Ui.Desktop/create-release-win.ps1 @@ -58,6 +58,9 @@ foreach ($rid in $rids) { $configuration = $using:configuration $framework = $using:framework $rid = $using:rid + $csp = $using:csp + $certKey = $using:certKey + $certTmpPath = $using:certTmpPath & { vpk pack -y `