From 421b6bb8e3eadee1e3ccb03007663e46b8c36502 Mon Sep 17 00:00:00 2001 From: leMicin Date: Mon, 16 Dec 2024 19:31:51 -0500 Subject: [PATCH 01/36] Added Velopack project and new auto updater --- Sidekick.sln | 7 ++ src/Sidekick.Apis.Velopack/AutoUpdater.cs | 29 +++++ src/Sidekick.Apis.Velopack/IAutoUpdater.cs | 13 ++ .../Sidekick.Apis.Velopack.csproj | 13 ++ .../StartupExtensions.cs | 16 +++ .../Setup/SetupPage.razor | 1 - .../Sidekick.Common.Blazor.csproj | 1 + .../Update/Update.razor | 112 ++++++++++++++++-- .../Update/UpdateOld.razor | 31 +++++ .../{Update.razor.cs => UpdateOld.razor.cs} | 7 +- src/Sidekick.Web/Program.cs | 2 + src/Sidekick.Wpf/App.xaml.cs | 2 + src/Sidekick.Wpf/Sidekick.Wpf.csproj | 1 + 13 files changed, 215 insertions(+), 20 deletions(-) create mode 100644 src/Sidekick.Apis.Velopack/AutoUpdater.cs create mode 100644 src/Sidekick.Apis.Velopack/IAutoUpdater.cs create mode 100644 src/Sidekick.Apis.Velopack/Sidekick.Apis.Velopack.csproj create mode 100644 src/Sidekick.Apis.Velopack/StartupExtensions.cs create mode 100644 src/Sidekick.Common.Blazor/Update/UpdateOld.razor rename src/Sidekick.Common.Blazor/Update/{Update.razor.cs => UpdateOld.razor.cs} (94%) diff --git a/Sidekick.sln b/Sidekick.sln index 45c4f2d92..7f0dea111 100644 --- a/Sidekick.sln +++ b/Sidekick.sln @@ -68,6 +68,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sidekick.Common.Database", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sidekick.Common.Ui", "src\Sidekick.Common.Ui\Sidekick.Common.Ui.csproj", "{F5B003D8-BE39-419A-A02A-4328A4FBDD10}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sidekick.Apis.Velopack", "src\Sidekick.Apis.Velopack\Sidekick.Apis.Velopack.csproj", "{2F2F03B3-213A-40D7-B818-8E618DDF01AF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -158,6 +160,10 @@ Global {F5B003D8-BE39-419A-A02A-4328A4FBDD10}.Debug|Any CPU.Build.0 = Debug|Any CPU {F5B003D8-BE39-419A-A02A-4328A4FBDD10}.Release|Any CPU.ActiveCfg = Release|Any CPU {F5B003D8-BE39-419A-A02A-4328A4FBDD10}.Release|Any CPU.Build.0 = Release|Any CPU + {2F2F03B3-213A-40D7-B818-8E618DDF01AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F2F03B3-213A-40D7-B818-8E618DDF01AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F2F03B3-213A-40D7-B818-8E618DDF01AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F2F03B3-213A-40D7-B818-8E618DDF01AF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -181,6 +187,7 @@ Global {70B9893F-72F8-4B5F-A9CF-732E538D6C9E} = {BB6816F5-1413-4545-96FA-D31D2D9BF6B1} {8C9915FA-EC66-47AA-B449-4833813B0D16} = {E4920CFB-0EED-44B1-AC8D-8F5ECBCB7788} {F5B003D8-BE39-419A-A02A-4328A4FBDD10} = {E4920CFB-0EED-44B1-AC8D-8F5ECBCB7788} + {2F2F03B3-213A-40D7-B818-8E618DDF01AF} = {7285BD58-2544-44AA-8488-52EA8E55D239} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {17B5631D-95B3-4007-BE6B-C9BBE799D014} diff --git a/src/Sidekick.Apis.Velopack/AutoUpdater.cs b/src/Sidekick.Apis.Velopack/AutoUpdater.cs new file mode 100644 index 000000000..094e2e484 --- /dev/null +++ b/src/Sidekick.Apis.Velopack/AutoUpdater.cs @@ -0,0 +1,29 @@ +using Microsoft.Extensions.Logging; +using Velopack; + +namespace Sidekick.Apis.Velopack; + +public class AutoUpdater( + ILogger logger) : IAutoUpdater +{ + public async Task CheckForUpdates() + { + var updateManager = new UpdateManager("https://sidekick-poe.github.io/Sidekick-Velopack/"); + + logger.LogInformation("[AutoAupdater] Checking for updates."); + var newVersion = await updateManager.CheckForUpdatesAsync(); + if (newVersion == null) + { + logger.LogInformation("[AutoAupdater] No updates found."); + return; + } + + // download new version + logger.LogInformation("[AutoAupdater] Downloading updates."); + await updateManager.DownloadUpdatesAsync(newVersion); + + // install new version and restart app + logger.LogInformation("[AutoAupdater] Applying updates and restarting."); + updateManager.ApplyUpdatesAndRestart(newVersion); + } +} diff --git a/src/Sidekick.Apis.Velopack/IAutoUpdater.cs b/src/Sidekick.Apis.Velopack/IAutoUpdater.cs new file mode 100644 index 000000000..54e7c5b6f --- /dev/null +++ b/src/Sidekick.Apis.Velopack/IAutoUpdater.cs @@ -0,0 +1,13 @@ +namespace Sidekick.Apis.Velopack; + +/// +/// Provides functionality to check for, download, and apply updates. +/// +public interface IAutoUpdater +{ + /// + /// Checks for available updates, downloads the updates if available, and applies them. + /// + /// A task that represents the asynchronous operation. + Task CheckForUpdates(); +} diff --git a/src/Sidekick.Apis.Velopack/Sidekick.Apis.Velopack.csproj b/src/Sidekick.Apis.Velopack/Sidekick.Apis.Velopack.csproj new file mode 100644 index 000000000..959432e4a --- /dev/null +++ b/src/Sidekick.Apis.Velopack/Sidekick.Apis.Velopack.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/src/Sidekick.Apis.Velopack/StartupExtensions.cs b/src/Sidekick.Apis.Velopack/StartupExtensions.cs new file mode 100644 index 000000000..b74e03025 --- /dev/null +++ b/src/Sidekick.Apis.Velopack/StartupExtensions.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.DependencyInjection; +using Velopack; + +namespace Sidekick.Apis.Velopack; + +public static class StartupExtensions +{ + public static IServiceCollection AddSidekickVelopack(this IServiceCollection services) + { + VelopackApp.Build().Run(); + + services.AddTransient(); + + return services; + } +} diff --git a/src/Sidekick.Common.Blazor/Setup/SetupPage.razor b/src/Sidekick.Common.Blazor/Setup/SetupPage.razor index a7ac445b0..2b938c51f 100644 --- a/src/Sidekick.Common.Blazor/Setup/SetupPage.razor +++ b/src/Sidekick.Common.Blazor/Setup/SetupPage.razor @@ -1,5 +1,4 @@ @page "/setup" -@page "/" @inherits Sidekick.Common.Ui.Views.SidekickView diff --git a/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj b/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj index 999476b6b..b797b49cd 100644 --- a/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj +++ b/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj @@ -15,6 +15,7 @@ + diff --git a/src/Sidekick.Common.Blazor/Update/Update.razor b/src/Sidekick.Common.Blazor/Update/Update.razor index 06dd343e6..91b3e0edd 100644 --- a/src/Sidekick.Common.Blazor/Update/Update.razor +++ b/src/Sidekick.Common.Blazor/Update/Update.razor @@ -1,4 +1,8 @@ @page "/update" +@page "/" +@using Sidekick.Apis.Velopack +@using Sidekick.Common.Browser +@using Sidekick.Common.Platform @inherits Sidekick.Common.Ui.Views.SidekickView @@ -8,24 +12,106 @@ - @if (Error) - { - @Resources["The update has failed to install automatically. You should try to download and install the update manually from https://sidekick-poe.github.io/"] - } - else - { - - @Step + + @if (Error) + { + @Resources["The update has failed to install automatically. You should try to download and install the update manually from https://sidekick-poe.github.io/"] + } + else if (NewLauncher) + { + @Resources["New launcher available!"] + @Resources["A new and improved launcher is available. Open the website to grab it. You can uninstall this version."] + } + else + { + @Resources["Checking for updates..."] - - } + } +
- - @Resources["Close"] - + @if (NewLauncher) + { + + @Resources["Exit"] + + + @Resources["Continue"] + + + @Resources["Open Website"] + + } + else + { + + @Resources["Exit"] + + }
+ +@inject ILogger Logger +@inject IStringLocalizer Resources +@inject IApplicationService ApplicationService +@inject IAutoUpdater AutoUpdater +@inject IBrowserProvider BrowserProvider + +@code { + + private bool Error { get; set; } + + private bool NewLauncher { get; set; } + + public override SidekickViewType ViewType => SidekickViewType.Modal; + + public override int ViewHeight => 210; + + protected override async Task OnInitializedAsync() + { + await CurrentView.Initialize(this); + await base.OnInitializedAsync(); + + try + { + await AutoUpdater.CheckForUpdates(); + NavigationManager.NavigateTo("/setup"); + } + catch (Exception ex) + { + if (ex.Message == "Cannot perform this operation in an application which is not installed.") + { + NewLauncher = true; + } + else + { + Logger.LogError(ex.Message); + Error = true; + StateHasChanged(); + + await Task.Delay(1500); + NavigationManager.NavigateTo("/setup"); + } + } + } + + public void Continue() + { + NavigationManager.NavigateTo("/setup"); + } + + public void OpenWebsite() + { + BrowserProvider.OpenSidekickWebsite(); + } + + public void Exit() + { + ApplicationService.Shutdown(); + } + +} diff --git a/src/Sidekick.Common.Blazor/Update/UpdateOld.razor b/src/Sidekick.Common.Blazor/Update/UpdateOld.razor new file mode 100644 index 000000000..6631730af --- /dev/null +++ b/src/Sidekick.Common.Blazor/Update/UpdateOld.razor @@ -0,0 +1,31 @@ +@*page "/update"*@ +@inherits Sidekick.Common.Ui.Views.SidekickView + + + + + + + + + @if (Error) + { + @Resources["The update has failed to install automatically. You should try to download and install the update manually from https://sidekick-poe.github.io/"] + } + else + { + + @Step + + + } + + + +
+ + @Resources["Close"] + +
+
+
diff --git a/src/Sidekick.Common.Blazor/Update/Update.razor.cs b/src/Sidekick.Common.Blazor/Update/UpdateOld.razor.cs similarity index 94% rename from src/Sidekick.Common.Blazor/Update/Update.razor.cs rename to src/Sidekick.Common.Blazor/Update/UpdateOld.razor.cs index 23dcc4386..2c543b123 100644 --- a/src/Sidekick.Common.Blazor/Update/Update.razor.cs +++ b/src/Sidekick.Common.Blazor/Update/UpdateOld.razor.cs @@ -1,15 +1,13 @@ -using System.Diagnostics; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Sidekick.Apis.GitHub; using Sidekick.Common.Cache; using Sidekick.Common.Platform; -using Sidekick.Common.Ui.Views; namespace Sidekick.Common.Blazor.Update { - public partial class Update + public partial class UpdateOld { [Inject] private ILogger Logger { get; set; } = null!; @@ -26,9 +24,6 @@ public partial class Update [Inject] private ICacheProvider CacheProvider { get; set; } = null!; - [Inject] - private ICurrentView CurrentView { get; set; } = null!; - private string? Step { get; set; } private bool Error { get; set; } diff --git a/src/Sidekick.Web/Program.cs b/src/Sidekick.Web/Program.cs index 2b0113a26..a68104ad9 100644 --- a/src/Sidekick.Web/Program.cs +++ b/src/Sidekick.Web/Program.cs @@ -4,6 +4,7 @@ using Sidekick.Apis.PoeNinja; using Sidekick.Apis.PoePriceInfo; using Sidekick.Apis.PoeWiki; +using Sidekick.Apis.Velopack; using Sidekick.Common; using Sidekick.Common.Blazor; using Sidekick.Common.Database; @@ -47,6 +48,7 @@ .AddSidekickPoeNinjaApi() .AddSidekickPoePriceInfoApi() .AddSidekickPoeWikiApi() + .AddSidekickVelopack() // Modules .AddSidekickChat() diff --git a/src/Sidekick.Wpf/App.xaml.cs b/src/Sidekick.Wpf/App.xaml.cs index ed4f1e0e8..7bfe41818 100644 --- a/src/Sidekick.Wpf/App.xaml.cs +++ b/src/Sidekick.Wpf/App.xaml.cs @@ -8,6 +8,7 @@ using Sidekick.Apis.PoeNinja; using Sidekick.Apis.PoePriceInfo; using Sidekick.Apis.PoeWiki; +using Sidekick.Apis.Velopack; using Sidekick.Common; using Sidekick.Common.Blazor; using Sidekick.Common.Database; @@ -144,6 +145,7 @@ private ServiceProvider GetServiceProvider() .AddSidekickPoeNinjaApi() .AddSidekickPoePriceInfoApi() .AddSidekickPoeWikiApi() + .AddSidekickVelopack() // Modules .AddSidekickChat() diff --git a/src/Sidekick.Wpf/Sidekick.Wpf.csproj b/src/Sidekick.Wpf/Sidekick.Wpf.csproj index ed3c6d7f7..7d14ee01e 100644 --- a/src/Sidekick.Wpf/Sidekick.Wpf.csproj +++ b/src/Sidekick.Wpf/Sidekick.Wpf.csproj @@ -48,6 +48,7 @@ + From bc13ea1d2bcde108787a423ae28bc15febd5a717 Mon Sep 17 00:00:00 2001 From: leMicin Date: Mon, 16 Dec 2024 22:01:47 -0500 Subject: [PATCH 02/36] Added velopack build pipelines --- .github/workflows/velopack-beta.yml | 119 +++++++++++++++ .github/workflows/velopack-release.yml | 200 +++++++++++++++++++++++++ 2 files changed, 319 insertions(+) create mode 100644 .github/workflows/velopack-beta.yml create mode 100644 .github/workflows/velopack-release.yml diff --git a/.github/workflows/velopack-beta.yml b/.github/workflows/velopack-beta.yml new file mode 100644 index 000000000..7e91628be --- /dev/null +++ b/.github/workflows/velopack-beta.yml @@ -0,0 +1,119 @@ +name: Velopack Beta + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + wpf-beta: + runs-on: windows-latest + + steps: + - name: Git - Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Version + id: version + run: | + # Get the current date + $DATE = Get-Date -Format "yyyy.M.d" + + # Get the current time in hours and minutes (24-hour format) + $TIME = Get-Date -Format "Hmm" + + # Construct the version using DATE and TIME + $VERSION = "$DATE.$TIME" + Write-Output "Generated version: $VERSION" + + # Export version as an output + echo "version=$VERSION" >> $env:GITHUB_OUTPUT + + - name: Version - Update project files + uses: vers-one/dotnet-project-version-updater@v1.7 + with: + file: "src/**/*.csproj" + version: ${{ steps.version.outputs.version }} + + - name: Environment - Build Number + uses: myci-actions/export-env-var@1 + with: + name: BUILD_NUMBER + value: ${{ steps.version.outputs.version }} + + - name: Environment - Github Token + uses: myci-actions/export-env-var@1 + with: + name: GITHUB_TOKEN + value: ${{ github.token }} + + - name: .NET - Setup + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: .NET - Restore + run: dotnet restore + + - name: .NET - Build + run: dotnet build --no-restore + + - name: .NET - Tests + run: dotnet test --no-build --verbosity normal + + - name: Build - Sidekick.Protocol + run: dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build + + - name: Build - Sidekick.Wpf + shell: pwsh + run: | + $version = "${{ steps.version.outputs.version }}" + Write-Output "Version: $version" + + dotnet tool update -g vpk + dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained -r win-x64 -o .\velopack-publish + vpk pack -u Sidekick -v $version -p .\velopack-publish -e Sidekick.exe + + - name: Git - Setup + run: | + git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github + git config --global user.name github-actions + git config --global user.email github-actions@github.com + + - name: Git - Setup SSH + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.DEPLOY_VELOPACK }} + + - name: Git - Push to repository + shell: pwsh + run: | + $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Velopack.git" + Write-Output "Deploy repository: $deployRepository" + + # Clone `gh-pages` branch. + git clone $deployRepository -b gh-pages --single-branch "dist" + + Push-Location "dist" + try { + Write-Output "Removing previous files..." + if (Test-Path "Application Files") { + Remove-Item -Path "Application Files" -Recurse + } + if (Test-Path "Sidekick.application") { + Remove-Item -Path "Sidekick.application" + } + + Write-Output "Copying new files..." + Copy-Item -Path "../velopack-publish" -Destination . -Recurse + + # Stage and commit. + git add -A + git commit -m "Update to v$version" + git push + } finally { + Pop-Location + } diff --git a/.github/workflows/velopack-release.yml b/.github/workflows/velopack-release.yml new file mode 100644 index 000000000..1193bb1b8 --- /dev/null +++ b/.github/workflows/velopack-release.yml @@ -0,0 +1,200 @@ +name: Velopack Release + +on: + workflow_dispatch: + +jobs: + wpf-release: + runs-on: windows-latest + + steps: + - name: Git - Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Version + id: version + run: | + # Get the current date + $DATE = Get-Date -Format "yyyy.M.d" + + # Get the current time in hours and minutes (24-hour format) + $TIME = Get-Date -Format "Hmm" + + # Construct the version using DATE and TIME + $VERSION = "$DATE.$TIME" + Write-Output "Generated version: $VERSION" + + # Export version as an output + echo "version=$VERSION" >> $env:GITHUB_OUTPUT + + - name: Version - Update project files + uses: vers-one/dotnet-project-version-updater@v1.7 + with: + file: "src/**/*.csproj" + version: ${{ steps.version.outputs.version }} + + - name: Environment - Build Number + uses: myci-actions/export-env-var@1 + with: + name: BUILD_NUMBER + value: ${{ steps.version.outputs.version }} + + - name: Environment - Github Token + uses: myci-actions/export-env-var@1 + with: + name: GITHUB_TOKEN + value: ${{ github.token }} + + - name: Release - Notes + uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + name: 'Release v${{ steps.version.outputs.version }}' + tag: 'v${{ steps.version.outputs.version }}' + version: 'v${{ steps.version.outputs.version }}' + publish: false + prerelease: false + + - name: .NET - Setup + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: .NET - Restore + run: dotnet restore + + - name: .NET - Build + run: dotnet build --no-restore + + - name: .NET - Tests + run: dotnet test --no-build --verbosity normal + + - name: Build - Sidekick.Protocol + run: dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build + + - name: ClickOnce - Build + shell: pwsh + run: | + $version = "${{ steps.version.outputs.version }}" + Write-Output "Version: $version" + + # Find MSBuild. + $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` + -prerelease | select-object -first 1 + + Push-Location "src/Sidekick.Wpf" + & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceRelease /property:ApplicationVersion=$version + Pop-Location + + - name: ClickOnce - Git Setup + run: | + git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github + git config --global user.name github-actions + git config --global user.email github-actions@github.com + + - name: ClickOnce - Git Setup SSH + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.DEPLOY_RELEASE_KEY }} + + - name: ClickOnce - Git Push + shell: pwsh + run: | + $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Release.git" + Write-Output "Deploy repository: $deployRepository" + + # Clone `gh-pages` branch. + git clone $deployRepository -b gh-pages --single-branch "dist" + + Push-Location "dist" + try { + Write-Output "Removing previous files..." + if (Test-Path "Application Files") { + Remove-Item -Path "Application Files" -Recurse + } + if (Test-Path "Sidekick.application") { + Remove-Item -Path "Sidekick.application" + } + + Write-Output "Copying new files..." + Copy-Item -Path "../src/Sidekick.Wpf/bin/publish/Application Files","../src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination . -Recurse + + # Stage and commit. + git add -A + git commit -m "Update to v$version" + git push + } finally { + Pop-Location + } + + - name: Zip - Build + shell: pwsh + run: | + $version = "${{ steps.version.outputs.version }}" + Write-Output "Version: $version" + + # Define the publish path + $publishPath = "bin/zip-publish" + + # Remove existing files if the folder exists + if (Test-Path -Path $publishPath) { + Write-Output "Removing existing files from $publishPath..." + Remove-Item -Path $publishPath -Recurse -Force + } + + # Create the folder if it doesn't exist + if (!(Test-Path -Path $publishPath)) { + New-Item -ItemType Directory -Force -Path $publishPath | Out-Null + Write-Output "$publishPath created" + } + + # Find MSBuild. + $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` + -prerelease | Select-Object -First 1 + + Push-Location "src/Sidekick.Wpf" + + # Run the build command with a self-contained mode + & $msBuildPath Sidekick.Wpf.csproj ` + /target:Publish ` + /property:PublishDir=$publishPath\ ` + /property:SelfContained=true ` + /property:ApplicationVersion=$version + + Pop-Location + + - name: Zip - Archive + shell: pwsh + run: | + $publishPath = "src/Sidekick.Wpf/bin/zip-publish" + $zipFilePath = "dist/Sidekick_v${{ steps.version.outputs.version }}.zip" + if (Test-Path -Path $zipFilePath) { + Remove-Item -Path $zipFilePath -Force + } + Compress-Archive -Path $publishPath\* -DestinationPath $zipFilePath + Write-Host "Files zipped successfully to $zipFilePath" + + - name: Release - Asset + uses: xresloader/upload-to-github-release@v1.3.4 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + file: 'download-instructions.txt' + tag_name: 'v${{ steps.version.outputs.version }}' + draft: true + verbose: true + overwrite: true + + - name: Release - Zip + uses: xresloader/upload-to-github-release@v1.3.4 + with: + file: 'dist/Sidekick_v${{ steps.version.outputs.version }}.zip' + tag_name: 'v${{ steps.version.outputs.version }}' + draft: true + verbose: true + overwrite: true From 8897ede3cdff5b12c2ce87e647b8afbd13931521 Mon Sep 17 00:00:00 2001 From: leMicin Date: Mon, 16 Dec 2024 22:26:59 -0500 Subject: [PATCH 03/36] Updated velopack pipeline --- .github/workflows/velopack-beta.yml | 4 ++-- Sidekick.sln | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/velopack-beta.yml b/.github/workflows/velopack-beta.yml index 7e91628be..484651b45 100644 --- a/.github/workflows/velopack-beta.yml +++ b/.github/workflows/velopack-beta.yml @@ -3,7 +3,7 @@ name: Velopack Beta on: push: branches: - - main + - main workflow_dispatch: jobs: @@ -75,7 +75,7 @@ jobs: dotnet tool update -g vpk dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained -r win-x64 -o .\velopack-publish - vpk pack -u Sidekick -v $version -p .\velopack-publish -e Sidekick.exe + vpk pack -u Sidekick -v $version -p .\velopack-publish --channel win-beta -e Sidekick.exe - name: Git - Setup run: | diff --git a/Sidekick.sln b/Sidekick.sln index 7f0dea111..fae0081f5 100644 --- a/Sidekick.sln +++ b/Sidekick.sln @@ -16,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution", "_Solution", "{ .github\workflows\wpf-beta.yml = .github\workflows\wpf-beta.yml .github\workflows\wpf-release.yml = .github\workflows\wpf-release.yml download-instructions.txt = download-instructions.txt + .github\workflows\velopack-beta.yml = .github\workflows\velopack-beta.yml + .github\workflows\velopack-release.yml = .github\workflows\velopack-release.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{E4920CFB-0EED-44B1-AC8D-8F5ECBCB7788}" From c5f9703b3494ee5b6fb0481075ed5c30ea855b26 Mon Sep 17 00:00:00 2001 From: leMicin Date: Mon, 16 Dec 2024 22:50:08 -0500 Subject: [PATCH 04/36] Updated beta version number --- .github/workflows/{velopack-beta.yml => beta.yml} | 2 +- .github/workflows/{velopack-release.yml => release.yml} | 0 Sidekick.sln | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{velopack-beta.yml => beta.yml} (98%) rename .github/workflows/{velopack-release.yml => release.yml} (100%) diff --git a/.github/workflows/velopack-beta.yml b/.github/workflows/beta.yml similarity index 98% rename from .github/workflows/velopack-beta.yml rename to .github/workflows/beta.yml index 484651b45..881d8f3cb 100644 --- a/.github/workflows/velopack-beta.yml +++ b/.github/workflows/beta.yml @@ -20,7 +20,7 @@ jobs: id: version run: | # Get the current date - $DATE = Get-Date -Format "yyyy.M.d" + $DATE = Get-Date -Format "yyyy.Md" # Get the current time in hours and minutes (24-hour format) $TIME = Get-Date -Format "Hmm" diff --git a/.github/workflows/velopack-release.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/velopack-release.yml rename to .github/workflows/release.yml diff --git a/Sidekick.sln b/Sidekick.sln index fae0081f5..2ee4e661f 100644 --- a/Sidekick.sln +++ b/Sidekick.sln @@ -16,8 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution", "_Solution", "{ .github\workflows\wpf-beta.yml = .github\workflows\wpf-beta.yml .github\workflows\wpf-release.yml = .github\workflows\wpf-release.yml download-instructions.txt = download-instructions.txt - .github\workflows\velopack-beta.yml = .github\workflows\velopack-beta.yml - .github\workflows\velopack-release.yml = .github\workflows\velopack-release.yml + .github\workflows\beta.yml = .github\workflows\beta.yml + .github\workflows\release.yml = .github\workflows\release.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{E4920CFB-0EED-44B1-AC8D-8F5ECBCB7788}" From e56226c7bc6801c020b555721135e2638606fa4f Mon Sep 17 00:00:00 2001 From: leMicin Date: Mon, 16 Dec 2024 23:01:41 -0500 Subject: [PATCH 05/36] Updated build name --- .github/workflows/beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 881d8f3cb..3ffdbcde7 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - wpf-beta: + beta: runs-on: windows-latest steps: From 342d203ad08047b34278292912e7aecf58870eac Mon Sep 17 00:00:00 2001 From: leMicin Date: Mon, 16 Dec 2024 23:25:52 -0500 Subject: [PATCH 06/36] Renamed the workflows --- .github/workflows/beta.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 3ffdbcde7..3024ebae1 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -1,4 +1,4 @@ -name: Velopack Beta +name: Beta on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1193bb1b8..2d4e23bc0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Velopack Release +name: Release on: workflow_dispatch: From 9fd9550f97c069169df761aa349a41549420fd3d Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 18 Dec 2024 15:35:22 -0500 Subject: [PATCH 07/36] Moved VelopackApp.Build().Run() so the build can work --- src/Sidekick.Apis.Velopack/StartupExtensions.cs | 3 --- src/Sidekick.Wpf/MainWindow.xaml.cs | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sidekick.Apis.Velopack/StartupExtensions.cs b/src/Sidekick.Apis.Velopack/StartupExtensions.cs index b74e03025..10aa526e2 100644 --- a/src/Sidekick.Apis.Velopack/StartupExtensions.cs +++ b/src/Sidekick.Apis.Velopack/StartupExtensions.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using Velopack; namespace Sidekick.Apis.Velopack; @@ -7,8 +6,6 @@ public static class StartupExtensions { public static IServiceCollection AddSidekickVelopack(this IServiceCollection services) { - VelopackApp.Build().Run(); - services.AddTransient(); return services; diff --git a/src/Sidekick.Wpf/MainWindow.xaml.cs b/src/Sidekick.Wpf/MainWindow.xaml.cs index 4467584ac..88e4fbad7 100644 --- a/src/Sidekick.Wpf/MainWindow.xaml.cs +++ b/src/Sidekick.Wpf/MainWindow.xaml.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.DependencyInjection; using Sidekick.Common.Ui.Views; using Sidekick.Wpf.Services; +using Velopack; namespace Sidekick.Wpf; @@ -26,6 +27,8 @@ public partial class MainWindow public MainWindow(WpfViewLocator viewLocator) { + VelopackApp.Build().Run(); + Scope = App.ServiceProvider.CreateScope(); Resources.Add("services", Scope.ServiceProvider); InitializeComponent(); From 6070f9574636379d2eef5dbd4b28323728c90215 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 18 Dec 2024 16:26:38 -0500 Subject: [PATCH 08/36] Updated beta workflow --- .github/workflows/beta.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 3024ebae1..f17189339 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -91,24 +91,25 @@ jobs: - name: Git - Push to repository shell: pwsh run: | + $version = "${{ steps.version.outputs.version }}" $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Velopack.git" Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "dist" + git clone $deployRepository -b gh-pages --single-branch "Velopack" - Push-Location "dist" + Push-Location "Velopack" try { Write-Output "Removing previous files..." - if (Test-Path "Application Files") { - Remove-Item -Path "Application Files" -Recurse + if (Test-Path "velopack-publish") { + Remove-Item -Path "velopack-publish" -Recurse } if (Test-Path "Sidekick.application") { Remove-Item -Path "Sidekick.application" } Write-Output "Copying new files..." - Copy-Item -Path "../velopack-publish" -Destination . -Recurse + Copy-Item -Path "../Releases" -Destination ./Releases -Recurse # Stage and commit. git add -A From 87e06edbab4d9d58cb2607884077b95d3a826341 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 18 Dec 2024 16:57:07 -0500 Subject: [PATCH 09/36] Remove self-contained --- .github/workflows/beta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index f17189339..ee8a9be48 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -74,7 +74,8 @@ jobs: Write-Output "Version: $version" dotnet tool update -g vpk - dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained -r win-x64 -o .\velopack-publish + # dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained -r win-x64 -o .\velopack-publish + dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release -r win-x64 -o .\velopack-publish vpk pack -u Sidekick -v $version -p .\velopack-publish --channel win-beta -e Sidekick.exe - name: Git - Setup From 331bab35472490816db2a81e35174797ce7e20b7 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 18 Dec 2024 17:11:28 -0500 Subject: [PATCH 10/36] Restored original command --- .github/workflows/beta.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index ee8a9be48..0e5edcad5 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -74,9 +74,8 @@ jobs: Write-Output "Version: $version" dotnet tool update -g vpk - # dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained -r win-x64 -o .\velopack-publish - dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release -r win-x64 -o .\velopack-publish - vpk pack -u Sidekick -v $version -p .\velopack-publish --channel win-beta -e Sidekick.exe + dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained -r win-x64 -o .\velopack-publish + vpk pack -u Sidekick -v $version -p .\velopack-publish --channel beta-win -e Sidekick.exe - name: Git - Setup run: | From 6dcef80e8d40e60467e4097290be6f38432421c0 Mon Sep 17 00:00:00 2001 From: Yanic Lemire Date: Wed, 18 Dec 2024 17:19:07 -0500 Subject: [PATCH 11/36] Update beta.yml --- .github/workflows/beta.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 0e5edcad5..7e81b5669 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -74,8 +74,8 @@ jobs: Write-Output "Version: $version" dotnet tool update -g vpk - dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained -r win-x64 -o .\velopack-publish - vpk pack -u Sidekick -v $version -p .\velopack-publish --channel beta-win -e Sidekick.exe + dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained false -r win-x64 -o .\Publish + vpk pack -u Sidekick -v $version -p .\Publish --channel beta-win -e Sidekick.exe - name: Git - Setup run: | @@ -96,7 +96,7 @@ jobs: Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "Velopack" + git clone $deployRepository -b gh-pages --single-branch "Publish-Repository" Push-Location "Velopack" try { @@ -109,7 +109,7 @@ jobs: } Write-Output "Copying new files..." - Copy-Item -Path "../Releases" -Destination ./Releases -Recurse + Copy-Item -Path "../Releases" -Destination ./Publish-Repository -Recurse # Stage and commit. git add -A From db36c1ff2265df105600c713397fdda973392b78 Mon Sep 17 00:00:00 2001 From: leMicin Date: Fri, 20 Dec 2024 13:25:24 -0500 Subject: [PATCH 12/36] Improved update check --- src/Sidekick.Apis.GitHub/GitHubClient.cs | 16 ++++++- .../Settings/SettingsLayout.razor | 2 +- .../Update/UpdateBanner.razor | 9 ---- src/Sidekick.Common.Ui/App/AppBar.razor | 1 + src/Sidekick.Common.Ui/App/AppClose.razor | 3 +- src/Sidekick.Common.Ui/App/AppUpdate.razor | 45 +++++++++++++++++++ .../Sidekick.Common.Ui.csproj | 1 + src/Sidekick.Common.Ui/wwwroot/css/app.css | 10 +++++ 8 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 src/Sidekick.Common.Ui/App/AppUpdate.razor diff --git a/src/Sidekick.Apis.GitHub/GitHubClient.cs b/src/Sidekick.Apis.GitHub/GitHubClient.cs index 09972782b..877811a0f 100644 --- a/src/Sidekick.Apis.GitHub/GitHubClient.cs +++ b/src/Sidekick.Apis.GitHub/GitHubClient.cs @@ -1,3 +1,4 @@ +using System.Diagnostics; using System.Net.Http.Headers; using System.Text.Json; using System.Text.Json.Serialization; @@ -16,6 +17,8 @@ public class GitHubClient( { private const string IndicatorPath = "SidekickGitHub"; + private DateTimeOffset? LastUpdateCheck { get; set; } + private GitHubRelease? LatestRelease { get; set; } /// @@ -66,11 +69,22 @@ public async Task DownloadGitHubDownloadIndicatorFile() /// public async Task GetLatestRelease() { - if (LatestRelease != null) + if (LatestRelease != null && LastUpdateCheck >= DateTimeOffset.Now.AddHours(-6)) { return LatestRelease; } + LastUpdateCheck = DateTimeOffset.Now; + + if (Debugger.IsAttached) + { + return new GitHubRelease() + { + IsNewerVersion = true, + IsExecutable = true, + }; + } + var release = await GetLatestApiRelease(); if (release == null || release.Tag == null) { diff --git a/src/Sidekick.Common.Blazor/Settings/SettingsLayout.razor b/src/Sidekick.Common.Blazor/Settings/SettingsLayout.razor index 27b57e3fb..d97266f15 100644 --- a/src/Sidekick.Common.Blazor/Settings/SettingsLayout.razor +++ b/src/Sidekick.Common.Blazor/Settings/SettingsLayout.razor @@ -37,7 +37,7 @@ - + diff --git a/src/Sidekick.Common.Blazor/Update/UpdateBanner.razor b/src/Sidekick.Common.Blazor/Update/UpdateBanner.razor index 71124b11c..a36f16f21 100644 --- a/src/Sidekick.Common.Blazor/Update/UpdateBanner.razor +++ b/src/Sidekick.Common.Blazor/Update/UpdateBanner.razor @@ -42,15 +42,6 @@ { Release = await GitHubClient.GetLatestRelease(); - if (Debugger.IsAttached) - { - Release = new GitHubRelease() - { - IsNewerVersion = true, - IsExecutable = true, - }; - } - await base.OnInitializedAsync(); } diff --git a/src/Sidekick.Common.Ui/App/AppBar.razor b/src/Sidekick.Common.Ui/App/AppBar.razor index af2963559..bb985ba83 100644 --- a/src/Sidekick.Common.Ui/App/AppBar.razor +++ b/src/Sidekick.Common.Ui/App/AppBar.razor @@ -5,6 +5,7 @@
+ @ChildContent
diff --git a/src/Sidekick.Common.Ui/App/AppClose.razor b/src/Sidekick.Common.Ui/App/AppClose.razor index 32c5b7c41..62e552637 100644 --- a/src/Sidekick.Common.Ui/App/AppClose.razor +++ b/src/Sidekick.Common.Ui/App/AppClose.razor @@ -3,7 +3,7 @@ @onclick:preventDefault="true" @onclick:stopPropagation="true" tabindex="-1" - title="Close" + title="@Resources["Close"]" class="p-2 text-base font-medium tracking-wide text-white transition-colors duration-200 bg-red-900 hover:bg-red-700"> @@ -12,6 +12,7 @@ @inject IViewLocator ViewLocator @inject ICurrentView CurrentView +@inject IStringLocalizer Resources @code { diff --git a/src/Sidekick.Common.Ui/App/AppUpdate.razor b/src/Sidekick.Common.Ui/App/AppUpdate.razor new file mode 100644 index 000000000..c5c53af24 --- /dev/null +++ b/src/Sidekick.Common.Ui/App/AppUpdate.razor @@ -0,0 +1,45 @@ +@using Sidekick.Apis.GitHub; +@using Sidekick.Apis.GitHub.Models; +@using Sidekick.Common.Browser; + +@if (Release is + { + IsNewerVersion: true + }) +{ + +} + +@inject IGitHubClient GitHubClient +@inject IBrowserProvider Browser +@inject IStringLocalizer Resources + +@code { + + private GitHubRelease? Release { get; set; } + + /// + protected override async Task OnInitializedAsync() + { + Release = await GitHubClient.GetLatestRelease(); + + await base.OnInitializedAsync(); + } + + private void OnClick() + { + Browser.OpenSidekickWebsite(); + } + +} diff --git a/src/Sidekick.Common.Ui/Sidekick.Common.Ui.csproj b/src/Sidekick.Common.Ui/Sidekick.Common.Ui.csproj index 2781a27b9..dde404375 100644 --- a/src/Sidekick.Common.Ui/Sidekick.Common.Ui.csproj +++ b/src/Sidekick.Common.Ui/Sidekick.Common.Ui.csproj @@ -16,6 +16,7 @@
+ diff --git a/src/Sidekick.Common.Ui/wwwroot/css/app.css b/src/Sidekick.Common.Ui/wwwroot/css/app.css index 3a106f68e..a6dbcf02c 100644 --- a/src/Sidekick.Common.Ui/wwwroot/css/app.css +++ b/src/Sidekick.Common.Ui/wwwroot/css/app.css @@ -3062,6 +3062,11 @@ video { background-color: rgb(109 40 217 / var(--tw-bg-opacity)); } +.bg-violet-900 { + --tw-bg-opacity: 1; + background-color: rgb(76 29 149 / var(--tw-bg-opacity)); +} + .bg-white { --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); @@ -4215,6 +4220,11 @@ video { background-color: rgb(139 92 246 / var(--tw-bg-opacity)); } +.hover\:bg-violet-700:hover { + --tw-bg-opacity: 1; + background-color: rgb(109 40 217 / var(--tw-bg-opacity)); +} + .hover\:font-bold:hover { font-weight: 700; } From aaa7fbc7a1e23115bbf06f5ea6820c1b26b07de7 Mon Sep 17 00:00:00 2001 From: leMicin Date: Fri, 20 Dec 2024 13:28:10 -0500 Subject: [PATCH 13/36] Fixes after merge from main --- src/Sidekick.Common.Blazor/Update/Update.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sidekick.Common.Blazor/Update/Update.razor b/src/Sidekick.Common.Blazor/Update/Update.razor index 91b3e0edd..3075b6824 100644 --- a/src/Sidekick.Common.Blazor/Update/Update.razor +++ b/src/Sidekick.Common.Blazor/Update/Update.razor @@ -56,7 +56,7 @@ @inject ILogger Logger -@inject IStringLocalizer Resources +@inject IStringLocalizer Resources @inject IApplicationService ApplicationService @inject IAutoUpdater AutoUpdater @inject IBrowserProvider BrowserProvider From 55f64c2451232f576d312e981b4af51f433f45b8 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 01:04:57 -0500 Subject: [PATCH 14/36] Renamed project --- Sidekick.sln | 4 ++-- src/Sidekick.Common.Blazor/Setup/SetupPage.razor | 8 +------- .../Sidekick.Common.Blazor.csproj | 2 +- src/Sidekick.Common.Blazor/Update/Update.razor | 3 +-- .../AutoUpdater.cs | 13 +++++++------ .../IAutoUpdater.cs | 2 +- .../Sidekick.Common.Updater.csproj} | 0 .../StartupExtensions.cs | 4 ++-- src/Sidekick.Web/Program.cs | 5 +++-- src/Sidekick.Wpf/App.xaml.cs | 4 ++-- src/Sidekick.Wpf/Services/WpfViewLocator.cs | 13 ++++++------- src/Sidekick.Wpf/Sidekick.Wpf.csproj | 2 +- 12 files changed, 27 insertions(+), 33 deletions(-) rename src/{Sidekick.Apis.Velopack => Sidekick.Common.Updater}/AutoUpdater.cs (52%) rename src/{Sidekick.Apis.Velopack => Sidekick.Common.Updater}/IAutoUpdater.cs (91%) rename src/{Sidekick.Apis.Velopack/Sidekick.Apis.Velopack.csproj => Sidekick.Common.Updater/Sidekick.Common.Updater.csproj} (100%) rename src/{Sidekick.Apis.Velopack => Sidekick.Common.Updater}/StartupExtensions.cs (60%) diff --git a/Sidekick.sln b/Sidekick.sln index 2ee4e661f..ccb75a519 100644 --- a/Sidekick.sln +++ b/Sidekick.sln @@ -70,7 +70,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sidekick.Common.Database", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sidekick.Common.Ui", "src\Sidekick.Common.Ui\Sidekick.Common.Ui.csproj", "{F5B003D8-BE39-419A-A02A-4328A4FBDD10}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sidekick.Apis.Velopack", "src\Sidekick.Apis.Velopack\Sidekick.Apis.Velopack.csproj", "{2F2F03B3-213A-40D7-B818-8E618DDF01AF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sidekick.Common.Updater", "src\Sidekick.Common.Updater\Sidekick.Common.Updater.csproj", "{2F2F03B3-213A-40D7-B818-8E618DDF01AF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -189,7 +189,7 @@ Global {70B9893F-72F8-4B5F-A9CF-732E538D6C9E} = {BB6816F5-1413-4545-96FA-D31D2D9BF6B1} {8C9915FA-EC66-47AA-B449-4833813B0D16} = {E4920CFB-0EED-44B1-AC8D-8F5ECBCB7788} {F5B003D8-BE39-419A-A02A-4328A4FBDD10} = {E4920CFB-0EED-44B1-AC8D-8F5ECBCB7788} - {2F2F03B3-213A-40D7-B818-8E618DDF01AF} = {7285BD58-2544-44AA-8488-52EA8E55D239} + {2F2F03B3-213A-40D7-B818-8E618DDF01AF} = {E4920CFB-0EED-44B1-AC8D-8F5ECBCB7788} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {17B5631D-95B3-4007-BE6B-C9BBE799D014} diff --git a/src/Sidekick.Common.Blazor/Setup/SetupPage.razor b/src/Sidekick.Common.Blazor/Setup/SetupPage.razor index a92efcaad..77035821d 100644 --- a/src/Sidekick.Common.Blazor/Setup/SetupPage.razor +++ b/src/Sidekick.Common.Blazor/Setup/SetupPage.razor @@ -8,11 +8,5 @@ public override SidekickViewType ViewType => SidekickViewType.Modal; public override int ViewHeight => 210; - - protected override async Task OnInitializedAsync() - { - await CurrentView.Initialize(this); - await base.OnInitializedAsync(); - } - + } diff --git a/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj b/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj index b797b49cd..7f8c36a45 100644 --- a/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj +++ b/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Sidekick.Common.Blazor/Update/Update.razor b/src/Sidekick.Common.Blazor/Update/Update.razor index 3075b6824..ae68c5e98 100644 --- a/src/Sidekick.Common.Blazor/Update/Update.razor +++ b/src/Sidekick.Common.Blazor/Update/Update.razor @@ -1,6 +1,6 @@ @page "/update" @page "/" -@using Sidekick.Apis.Velopack +@using Sidekick.Common.Updater @using Sidekick.Common.Browser @using Sidekick.Common.Platform @inherits Sidekick.Common.Ui.Views.SidekickView @@ -73,7 +73,6 @@ protected override async Task OnInitializedAsync() { - await CurrentView.Initialize(this); await base.OnInitializedAsync(); try diff --git a/src/Sidekick.Apis.Velopack/AutoUpdater.cs b/src/Sidekick.Common.Updater/AutoUpdater.cs similarity index 52% rename from src/Sidekick.Apis.Velopack/AutoUpdater.cs rename to src/Sidekick.Common.Updater/AutoUpdater.cs index 094e2e484..09a5ac286 100644 --- a/src/Sidekick.Apis.Velopack/AutoUpdater.cs +++ b/src/Sidekick.Common.Updater/AutoUpdater.cs @@ -1,29 +1,30 @@ using Microsoft.Extensions.Logging; using Velopack; -namespace Sidekick.Apis.Velopack; +namespace Sidekick.Common.Updater; public class AutoUpdater( ILogger logger) : IAutoUpdater { public async Task CheckForUpdates() { - var updateManager = new UpdateManager("https://sidekick-poe.github.io/Sidekick-Velopack/"); + var source = new Velopack.Sources.GithubSource("https://github.com/Sidekick-Poe/Sidekick", null, false); + var updateManager = new UpdateManager(source); - logger.LogInformation("[AutoAupdater] Checking for updates."); + logger.LogInformation("[AutoUpdater] Checking for updates."); var newVersion = await updateManager.CheckForUpdatesAsync(); if (newVersion == null) { - logger.LogInformation("[AutoAupdater] No updates found."); + logger.LogInformation("[AutoUpdater] No updates found."); return; } // download new version - logger.LogInformation("[AutoAupdater] Downloading updates."); + logger.LogInformation("[AutoUpdater] Downloading updates."); await updateManager.DownloadUpdatesAsync(newVersion); // install new version and restart app - logger.LogInformation("[AutoAupdater] Applying updates and restarting."); + logger.LogInformation("[AutoUpdater] Applying updates and restarting."); updateManager.ApplyUpdatesAndRestart(newVersion); } } diff --git a/src/Sidekick.Apis.Velopack/IAutoUpdater.cs b/src/Sidekick.Common.Updater/IAutoUpdater.cs similarity index 91% rename from src/Sidekick.Apis.Velopack/IAutoUpdater.cs rename to src/Sidekick.Common.Updater/IAutoUpdater.cs index 54e7c5b6f..a1c266148 100644 --- a/src/Sidekick.Apis.Velopack/IAutoUpdater.cs +++ b/src/Sidekick.Common.Updater/IAutoUpdater.cs @@ -1,4 +1,4 @@ -namespace Sidekick.Apis.Velopack; +namespace Sidekick.Common.Updater; /// /// Provides functionality to check for, download, and apply updates. diff --git a/src/Sidekick.Apis.Velopack/Sidekick.Apis.Velopack.csproj b/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj similarity index 100% rename from src/Sidekick.Apis.Velopack/Sidekick.Apis.Velopack.csproj rename to src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj diff --git a/src/Sidekick.Apis.Velopack/StartupExtensions.cs b/src/Sidekick.Common.Updater/StartupExtensions.cs similarity index 60% rename from src/Sidekick.Apis.Velopack/StartupExtensions.cs rename to src/Sidekick.Common.Updater/StartupExtensions.cs index 10aa526e2..d75f04b18 100644 --- a/src/Sidekick.Apis.Velopack/StartupExtensions.cs +++ b/src/Sidekick.Common.Updater/StartupExtensions.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.DependencyInjection; -namespace Sidekick.Apis.Velopack; +namespace Sidekick.Common.Updater; public static class StartupExtensions { - public static IServiceCollection AddSidekickVelopack(this IServiceCollection services) + public static IServiceCollection AddSidekickUpdater(this IServiceCollection services) { services.AddTransient(); diff --git a/src/Sidekick.Web/Program.cs b/src/Sidekick.Web/Program.cs index 5861e42b1..140e2c187 100644 --- a/src/Sidekick.Web/Program.cs +++ b/src/Sidekick.Web/Program.cs @@ -4,7 +4,7 @@ using Sidekick.Apis.PoeNinja; using Sidekick.Apis.PoePriceInfo; using Sidekick.Apis.PoeWiki; -using Sidekick.Apis.Velopack; +using Sidekick.Common.Updater; using Sidekick.Common; using Sidekick.Common.Blazor; using Sidekick.Common.Database; @@ -38,6 +38,7 @@ .AddSidekickCommonDatabase(SidekickPaths.DatabasePath) .AddSidekickCommonUi() .AddSingleton() + // .AddSidekickCommonPlatform(o => // { // o.WindowsIconPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot/favicon.ico"); @@ -50,7 +51,7 @@ .AddSidekickPoeNinjaApi() .AddSidekickPoePriceInfoApi() .AddSidekickPoeWikiApi() - .AddSidekickVelopack() + .AddSidekickUpdater() // Modules .AddSidekickChat() diff --git a/src/Sidekick.Wpf/App.xaml.cs b/src/Sidekick.Wpf/App.xaml.cs index 555599378..613fe5e77 100644 --- a/src/Sidekick.Wpf/App.xaml.cs +++ b/src/Sidekick.Wpf/App.xaml.cs @@ -10,7 +10,7 @@ using Sidekick.Apis.PoeNinja; using Sidekick.Apis.PoePriceInfo; using Sidekick.Apis.PoeWiki; -using Sidekick.Apis.Velopack; +using Sidekick.Common.Updater; using Sidekick.Common; using Sidekick.Common.Blazor; using Sidekick.Common.Database; @@ -142,7 +142,7 @@ private ServiceProvider GetServiceProvider() .AddSidekickPoeNinjaApi() .AddSidekickPoePriceInfoApi() .AddSidekickPoeWikiApi() - .AddSidekickVelopack() + .AddSidekickUpdater() // Modules .AddSidekickChat() diff --git a/src/Sidekick.Wpf/Services/WpfViewLocator.cs b/src/Sidekick.Wpf/Services/WpfViewLocator.cs index da78ead1e..62c3eec88 100644 --- a/src/Sidekick.Wpf/Services/WpfViewLocator.cs +++ b/src/Sidekick.Wpf/Services/WpfViewLocator.cs @@ -186,15 +186,15 @@ public Task Minimize(SidekickView view) /// public Task Close(SidekickView view) { + if (!TryGetWindow(view.CurrentView, out var window)) + { + return Task.CompletedTask; + } + Application.Current.Dispatcher.Invoke(() => { try { - if (!TryGetWindow(view.CurrentView, out var window)) - { - return; - } - window.Close(); Windows.Remove(window); GC.Collect(); @@ -293,13 +293,12 @@ private void CloudflareServiceOnChallengeStarted(Uri uri) private bool TryGetWindow(ICurrentView view, out MainWindow window) { var windowResult = Windows.FirstOrDefault(x => x.Id == view.Id); - if (windowResult == null) { Application.Current.Dispatcher.Invoke(() => { var viewUrl = WebUtility.UrlDecode(view.Url); - windowResult = Windows.FirstOrDefault(x => x.CurrentWebPath == viewUrl)!; + windowResult = Windows.FirstOrDefault(x => x.CurrentWebPath == viewUrl); }); } diff --git a/src/Sidekick.Wpf/Sidekick.Wpf.csproj b/src/Sidekick.Wpf/Sidekick.Wpf.csproj index 8d907769c..83aa44e09 100644 --- a/src/Sidekick.Wpf/Sidekick.Wpf.csproj +++ b/src/Sidekick.Wpf/Sidekick.Wpf.csproj @@ -49,7 +49,7 @@ - + From 7d85522e48dac3fdf1b7586c3b9647de13a425c5 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 11:06:21 -0500 Subject: [PATCH 15/36] Moved project and update files to the updater project --- .../Settings/SettingsLayout.razor | 4 ---- .../Sidekick.Common.Blazor.csproj | 1 - src/Sidekick.Common.Ui/wwwroot/css/app.css | 10 ---------- .../Components}/Update.fr.resx | 0 .../Components}/Update.ko.resx | 0 .../Components}/Update.razor | 0 .../Components}/Update.resx | 0 .../Components}/UpdateBanner.razor | 0 .../Components}/UpdateOld.razor | 0 .../Components}/UpdateOld.razor.cs | 2 +- .../Sidekick.Common.Updater.csproj | 12 +++++++++++- src/Sidekick.Common.Updater/StartupExtensions.cs | 1 + src/Sidekick.Web/Sidekick.Web.csproj | 1 + 13 files changed, 14 insertions(+), 17 deletions(-) rename src/{Sidekick.Common.Blazor/Update => Sidekick.Common.Updater/Components}/Update.fr.resx (100%) rename src/{Sidekick.Common.Blazor/Update => Sidekick.Common.Updater/Components}/Update.ko.resx (100%) rename src/{Sidekick.Common.Blazor/Update => Sidekick.Common.Updater/Components}/Update.razor (100%) rename src/{Sidekick.Common.Blazor/Update => Sidekick.Common.Updater/Components}/Update.resx (100%) rename src/{Sidekick.Common.Blazor/Update => Sidekick.Common.Updater/Components}/UpdateBanner.razor (100%) rename src/{Sidekick.Common.Blazor/Update => Sidekick.Common.Updater/Components}/UpdateOld.razor (100%) rename src/{Sidekick.Common.Blazor/Update => Sidekick.Common.Updater/Components}/UpdateOld.razor.cs (98%) diff --git a/src/Sidekick.Common.Blazor/Settings/SettingsLayout.razor b/src/Sidekick.Common.Blazor/Settings/SettingsLayout.razor index 82e8458f0..f72219519 100644 --- a/src/Sidekick.Common.Blazor/Settings/SettingsLayout.razor +++ b/src/Sidekick.Common.Blazor/Settings/SettingsLayout.razor @@ -1,5 +1,4 @@ @using System.Diagnostics -@using Sidekick.Common.Blazor.Update @using Sidekick.Common.Cache @inherits LayoutComponentBase @@ -37,9 +36,6 @@ @Body - - - @inject IStringLocalizer Resources diff --git a/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj b/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj index 7f8c36a45..999476b6b 100644 --- a/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj +++ b/src/Sidekick.Common.Blazor/Sidekick.Common.Blazor.csproj @@ -15,7 +15,6 @@ - diff --git a/src/Sidekick.Common.Ui/wwwroot/css/app.css b/src/Sidekick.Common.Ui/wwwroot/css/app.css index afb7bdcc1..37a29a7ea 100644 --- a/src/Sidekick.Common.Ui/wwwroot/css/app.css +++ b/src/Sidekick.Common.Ui/wwwroot/css/app.css @@ -3067,11 +3067,6 @@ video { background-color: rgb(109 40 217 / var(--tw-bg-opacity)); } -.bg-violet-900 { - --tw-bg-opacity: 1; - background-color: rgb(76 29 149 / var(--tw-bg-opacity)); -} - .bg-white { --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); @@ -4230,11 +4225,6 @@ video { background-color: rgb(139 92 246 / var(--tw-bg-opacity)); } -.hover\:bg-violet-700:hover { - --tw-bg-opacity: 1; - background-color: rgb(109 40 217 / var(--tw-bg-opacity)); -} - .hover\:font-bold:hover { font-weight: 700; } diff --git a/src/Sidekick.Common.Blazor/Update/Update.fr.resx b/src/Sidekick.Common.Updater/Components/Update.fr.resx similarity index 100% rename from src/Sidekick.Common.Blazor/Update/Update.fr.resx rename to src/Sidekick.Common.Updater/Components/Update.fr.resx diff --git a/src/Sidekick.Common.Blazor/Update/Update.ko.resx b/src/Sidekick.Common.Updater/Components/Update.ko.resx similarity index 100% rename from src/Sidekick.Common.Blazor/Update/Update.ko.resx rename to src/Sidekick.Common.Updater/Components/Update.ko.resx diff --git a/src/Sidekick.Common.Blazor/Update/Update.razor b/src/Sidekick.Common.Updater/Components/Update.razor similarity index 100% rename from src/Sidekick.Common.Blazor/Update/Update.razor rename to src/Sidekick.Common.Updater/Components/Update.razor diff --git a/src/Sidekick.Common.Blazor/Update/Update.resx b/src/Sidekick.Common.Updater/Components/Update.resx similarity index 100% rename from src/Sidekick.Common.Blazor/Update/Update.resx rename to src/Sidekick.Common.Updater/Components/Update.resx diff --git a/src/Sidekick.Common.Blazor/Update/UpdateBanner.razor b/src/Sidekick.Common.Updater/Components/UpdateBanner.razor similarity index 100% rename from src/Sidekick.Common.Blazor/Update/UpdateBanner.razor rename to src/Sidekick.Common.Updater/Components/UpdateBanner.razor diff --git a/src/Sidekick.Common.Blazor/Update/UpdateOld.razor b/src/Sidekick.Common.Updater/Components/UpdateOld.razor similarity index 100% rename from src/Sidekick.Common.Blazor/Update/UpdateOld.razor rename to src/Sidekick.Common.Updater/Components/UpdateOld.razor diff --git a/src/Sidekick.Common.Blazor/Update/UpdateOld.razor.cs b/src/Sidekick.Common.Updater/Components/UpdateOld.razor.cs similarity index 98% rename from src/Sidekick.Common.Blazor/Update/UpdateOld.razor.cs rename to src/Sidekick.Common.Updater/Components/UpdateOld.razor.cs index 1337c1b04..308fe503d 100644 --- a/src/Sidekick.Common.Blazor/Update/UpdateOld.razor.cs +++ b/src/Sidekick.Common.Updater/Components/UpdateOld.razor.cs @@ -5,7 +5,7 @@ using Sidekick.Common.Cache; using Sidekick.Common.Platform; -namespace Sidekick.Common.Blazor.Update +namespace Sidekick.Common.Updater.Components { public partial class UpdateOld { diff --git a/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj b/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj index 959432e4a..eb3b7e216 100644 --- a/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj +++ b/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -10,4 +10,14 @@ + + + + + + + _Imports.razor + + + diff --git a/src/Sidekick.Common.Updater/StartupExtensions.cs b/src/Sidekick.Common.Updater/StartupExtensions.cs index d75f04b18..df054a377 100644 --- a/src/Sidekick.Common.Updater/StartupExtensions.cs +++ b/src/Sidekick.Common.Updater/StartupExtensions.cs @@ -7,6 +7,7 @@ public static class StartupExtensions public static IServiceCollection AddSidekickUpdater(this IServiceCollection services) { services.AddTransient(); + services.AddSidekickModule(typeof(StartupExtensions).Assembly); return services; } diff --git a/src/Sidekick.Web/Sidekick.Web.csproj b/src/Sidekick.Web/Sidekick.Web.csproj index a696596ca..fa851170b 100644 --- a/src/Sidekick.Web/Sidekick.Web.csproj +++ b/src/Sidekick.Web/Sidekick.Web.csproj @@ -13,6 +13,7 @@ + From 485f9f9f0fdc1403c85d09866a23f252551bcf0c Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 11:25:10 -0500 Subject: [PATCH 16/36] Moved the new launcher text to resources --- src/Sidekick.Common.Ui/App/AppUpdate.razor | 4 ++-- .../Components/Update.fr.resx | 3 +++ .../Components/Update.razor | 19 +++++++++++++------ .../Components/Update.resx | 14 +++++++++++++- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/Sidekick.Common.Ui/App/AppUpdate.razor b/src/Sidekick.Common.Ui/App/AppUpdate.razor index c5c53af24..0e2fcee26 100644 --- a/src/Sidekick.Common.Ui/App/AppUpdate.razor +++ b/src/Sidekick.Common.Ui/App/AppUpdate.razor @@ -22,8 +22,8 @@ } @inject IGitHubClient GitHubClient -@inject IBrowserProvider Browser @inject IStringLocalizer Resources +@inject IViewLocator ViewLocator @code { @@ -39,7 +39,7 @@ private void OnClick() { - Browser.OpenSidekickWebsite(); + ViewLocator.Open("/update"); } } diff --git a/src/Sidekick.Common.Updater/Components/Update.fr.resx b/src/Sidekick.Common.Updater/Components/Update.fr.resx index b77f0629e..27455262d 100644 --- a/src/Sidekick.Common.Updater/Components/Update.fr.resx +++ b/src/Sidekick.Common.Updater/Components/Update.fr.resx @@ -136,4 +136,7 @@ + + Continuer + \ No newline at end of file diff --git a/src/Sidekick.Common.Updater/Components/Update.razor b/src/Sidekick.Common.Updater/Components/Update.razor index ae68c5e98..34ccef2f9 100644 --- a/src/Sidekick.Common.Updater/Components/Update.razor +++ b/src/Sidekick.Common.Updater/Components/Update.razor @@ -15,17 +15,17 @@ @if (Error) { - @Resources["The update has failed to install automatically. You should try to download and install the update manually from https://sidekick-poe.github.io/"] + @Resources["Update_Cant_Download"] } else if (NewLauncher) { - @Resources["New launcher available!"] + @Resources["NewLauncher"] @Resources["A new and improved launcher is available. Open the website to grab it. You can uninstall this version."] + Class="text-center">@Resources["NewLauncherText"] } else { - @Resources["Checking for updates..."] + @Resources["Checking_For_Updates"] } @@ -42,7 +42,7 @@ @Resources["Continue"] - @Resources["Open Website"] + @Resources["Open_Website"] } else @@ -100,7 +100,14 @@ public void Continue() { - NavigationManager.NavigateTo("/setup"); + if (NavigationManager.Uri.Contains("/update")) + { + CurrentView.Close(); + } + else + { + NavigationManager.NavigateTo("/setup"); + } } public void OpenWebsite() diff --git a/src/Sidekick.Common.Updater/Components/Update.resx b/src/Sidekick.Common.Updater/Components/Update.resx index 5c5085b96..bbcfa02e1 100644 --- a/src/Sidekick.Common.Updater/Components/Update.resx +++ b/src/Sidekick.Common.Updater/Components/Update.resx @@ -135,4 +135,16 @@ Could not download the update automatically. You can try to download the latest version from https://sidekick-poe.github.io/ - \ No newline at end of file + + Continue + + + Exit + + + New launcher available! + + + A new and improved launcher is available. Open the website to grab it. You can uninstall this version. + + From 9d98d30394949248168a71d0fab44632fcd9fc06 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 17:11:05 -0500 Subject: [PATCH 17/36] Updated workflows --- .github/workflows/beta.yml | 81 +++++++++------ .github/workflows/release.yml | 160 ++++++++++-------------------- .github/workflows/wpf-release.yml | 2 +- 3 files changed, 105 insertions(+), 138 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 7e81b5669..11eb0602d 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -38,6 +38,17 @@ jobs: file: "src/**/*.csproj" version: ${{ steps.version.outputs.version }} + - name: Release Notes + uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + name: 'Sidekick v${{ steps.version.outputs.version }}' + tag: 'v${{ steps.version.outputs.version }}' + version: 'v${{ steps.version.outputs.version }}' + publish: false + prerelease: true + - name: Environment - Build Number uses: myci-actions/export-env-var@1 with: @@ -55,66 +66,80 @@ jobs: with: dotnet-version: 8.x - - name: .NET - Restore - run: dotnet restore - - - name: .NET - Build - run: dotnet build --no-restore - - name: .NET - Tests - run: dotnet test --no-build --verbosity normal - - - name: Build - Sidekick.Protocol - run: dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build + shell: pwsh + run: | + dotnet restore + dotnet build --no-restore + dotnet test --no-build --verbosity normal - - name: Build - Sidekick.Wpf + - name: .NET - Publish shell: pwsh run: | $version = "${{ steps.version.outputs.version }}" Write-Output "Version: $version" - dotnet tool update -g vpk - dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained false -r win-x64 -o .\Publish - vpk pack -u Sidekick -v $version -p .\Publish --channel beta-win -e Sidekick.exe + dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build + dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained false -r win-x64 -o ./Publish - - name: Git - Setup + - name: Velopack + shell: pwsh run: | - git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github - git config --global user.name github-actions - git config --global user.email github-actions@github.com + $version = "${{ steps.version.outputs.version }}" + Write-Output "Version: $version" - - name: Git - Setup SSH + dotnet tool install -g vpk + vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick + vpk pack -u Sidekick -v $version -p Publish + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version + + - name: ClickOnce - Git Key uses: webfactory/ssh-agent@v0.7.0 with: - ssh-private-key: ${{ secrets.DEPLOY_VELOPACK }} + ssh-private-key: ${{ secrets.DEPLOY_BETA_KEY }} - - name: Git - Push to repository + - name: ClickOnce shell: pwsh run: | $version = "${{ steps.version.outputs.version }}" - $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Velopack.git" + Write-Output "Version: $version" + + git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github + git config --global user.name github-actions + git config --global user.email github-actions@github.com + + # Find MSBuild. + $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` + -prerelease | select-object -first 1 + + Push-Location "src/Sidekick.Wpf" + & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version + Pop-Location + + $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Beta.git" Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "Publish-Repository" + git clone $deployRepository -b gh-pages --single-branch "dist" - Push-Location "Velopack" + Push-Location "dist" try { Write-Output "Removing previous files..." - if (Test-Path "velopack-publish") { - Remove-Item -Path "velopack-publish" -Recurse + if (Test-Path "Application Files") { + Remove-Item -Path "Application Files" -Recurse } if (Test-Path "Sidekick.application") { Remove-Item -Path "Sidekick.application" } Write-Output "Copying new files..." - Copy-Item -Path "../Releases" -Destination ./Publish-Repository -Recurse + Copy-Item -Path "../src/Sidekick.Wpf/bin/publish/Application Files","../src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination . -Recurse # Stage and commit. git add -A git commit -m "Update to v$version" - git push + # git push } finally { Pop-Location } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d4e23bc0..d1090189e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,10 @@ -name: Release +name: Beta on: workflow_dispatch: jobs: - wpf-release: + beta: runs-on: windows-latest steps: @@ -17,7 +17,7 @@ jobs: id: version run: | # Get the current date - $DATE = Get-Date -Format "yyyy.M.d" + $DATE = Get-Date -Format "yyyy.Md" # Get the current time in hours and minutes (24-hour format) $TIME = Get-Date -Format "Hmm" @@ -35,6 +35,17 @@ jobs: file: "src/**/*.csproj" version: ${{ steps.version.outputs.version }} + - name: Release Notes + uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + name: 'Sidekick v${{ steps.version.outputs.version }}' + tag: 'v${{ steps.version.outputs.version }}' + version: 'v${{ steps.version.outputs.version }}' + publish: false + prerelease: false + - name: Environment - Build Number uses: myci-actions/export-env-var@1 with: @@ -47,64 +58,63 @@ jobs: name: GITHUB_TOKEN value: ${{ github.token }} - - name: Release - Notes - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - name: 'Release v${{ steps.version.outputs.version }}' - tag: 'v${{ steps.version.outputs.version }}' - version: 'v${{ steps.version.outputs.version }}' - publish: false - prerelease: false - - name: .NET - Setup uses: actions/setup-dotnet@v1 with: dotnet-version: 8.x - - name: .NET - Restore - run: dotnet restore + - name: .NET - Tests + shell: pwsh + run: | + dotnet restore + dotnet build --no-restore + dotnet test --no-build --verbosity normal - - name: .NET - Build - run: dotnet build --no-restore + - name: .NET - Publish + shell: pwsh + run: | + $version = "${{ steps.version.outputs.version }}" + Write-Output "Version: $version" - - name: .NET - Tests - run: dotnet test --no-build --verbosity normal + dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build + dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained false -r win-x64 -o ./Publish - - name: Build - Sidekick.Protocol - run: dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build + - name: Velopack + shell: pwsh + run: | + $version = "${{ steps.version.outputs.version }}" + Write-Output "Version: $version" + + dotnet tool install -g vpk + vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick + vpk pack -u Sidekick -v $version -p Publish + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel win-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version + + - name: ClickOnce - Git Key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.DEPLOY_BETA_KEY }} - - name: ClickOnce - Build + - name: ClickOnce shell: pwsh run: | $version = "${{ steps.version.outputs.version }}" Write-Output "Version: $version" + git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github + git config --global user.name github-actions + git config --global user.email github-actions@github.com + # Find MSBuild. $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` -prerelease | select-object -first 1 Push-Location "src/Sidekick.Wpf" - & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceRelease /property:ApplicationVersion=$version + & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version Pop-Location - - - name: ClickOnce - Git Setup - run: | - git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github - git config --global user.name github-actions - git config --global user.email github-actions@github.com - - - name: ClickOnce - Git Setup SSH - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.DEPLOY_RELEASE_KEY }} - - - name: ClickOnce - Git Push - shell: pwsh - run: | - $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Release.git" + + $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Beta.git" Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. @@ -126,75 +136,7 @@ jobs: # Stage and commit. git add -A git commit -m "Update to v$version" - git push + # git push } finally { Pop-Location } - - - name: Zip - Build - shell: pwsh - run: | - $version = "${{ steps.version.outputs.version }}" - Write-Output "Version: $version" - - # Define the publish path - $publishPath = "bin/zip-publish" - - # Remove existing files if the folder exists - if (Test-Path -Path $publishPath) { - Write-Output "Removing existing files from $publishPath..." - Remove-Item -Path $publishPath -Recurse -Force - } - - # Create the folder if it doesn't exist - if (!(Test-Path -Path $publishPath)) { - New-Item -ItemType Directory -Force -Path $publishPath | Out-Null - Write-Output "$publishPath created" - } - - # Find MSBuild. - $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` - -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` - -prerelease | Select-Object -First 1 - - Push-Location "src/Sidekick.Wpf" - - # Run the build command with a self-contained mode - & $msBuildPath Sidekick.Wpf.csproj ` - /target:Publish ` - /property:PublishDir=$publishPath\ ` - /property:SelfContained=true ` - /property:ApplicationVersion=$version - - Pop-Location - - - name: Zip - Archive - shell: pwsh - run: | - $publishPath = "src/Sidekick.Wpf/bin/zip-publish" - $zipFilePath = "dist/Sidekick_v${{ steps.version.outputs.version }}.zip" - if (Test-Path -Path $zipFilePath) { - Remove-Item -Path $zipFilePath -Force - } - Compress-Archive -Path $publishPath\* -DestinationPath $zipFilePath - Write-Host "Files zipped successfully to $zipFilePath" - - - name: Release - Asset - uses: xresloader/upload-to-github-release@v1.3.4 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - file: 'download-instructions.txt' - tag_name: 'v${{ steps.version.outputs.version }}' - draft: true - verbose: true - overwrite: true - - - name: Release - Zip - uses: xresloader/upload-to-github-release@v1.3.4 - with: - file: 'dist/Sidekick_v${{ steps.version.outputs.version }}.zip' - tag_name: 'v${{ steps.version.outputs.version }}' - draft: true - verbose: true - overwrite: true diff --git a/.github/workflows/wpf-release.yml b/.github/workflows/wpf-release.yml index 0d798b9f1..28dad8e4c 100644 --- a/.github/workflows/wpf-release.yml +++ b/.github/workflows/wpf-release.yml @@ -52,7 +52,7 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} with: - name: 'Release v${{ steps.version.outputs.version }}' + name: 'Sidekick v${{ steps.version.outputs.version }}' tag: 'v${{ steps.version.outputs.version }}' version: 'v${{ steps.version.outputs.version }}' publish: false From 0d4fe90a7c85d9780b0cf0954e9078e065af6556 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 17:29:24 -0500 Subject: [PATCH 18/36] Updated workflows --- .github/workflows/beta.yml | 4 ++-- .github/workflows/release.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 11eb0602d..bc5819b74 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -89,8 +89,8 @@ jobs: Write-Output "Version: $version" dotnet tool install -g vpk - vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick - vpk pack -u Sidekick -v $version -p Publish + vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta + vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version - name: ClickOnce - Git Key diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1090189e..65c6af957 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,9 +86,9 @@ jobs: Write-Output "Version: $version" dotnet tool install -g vpk - vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick - vpk pack -u Sidekick -v $version -p Publish - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel win-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version + vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows + vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows --merge --releaseName "Sidekick v$version" --tag v$version - name: ClickOnce - Git Key uses: webfactory/ssh-agent@v0.7.0 From 734245d0ce92848ab05444b1abaee3453d9c4a33 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 17:44:19 -0500 Subject: [PATCH 19/36] Updated workflows --- .github/workflows/beta.yml | 2 +- .github/workflows/release.yml | 2 +- src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index bc5819b74..68f4b4d50 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -91,7 +91,7 @@ jobs: dotnet tool install -g vpk vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} - name: ClickOnce - Git Key uses: webfactory/ssh-agent@v0.7.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65c6af957..078d50a6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,7 +88,7 @@ jobs: dotnet tool install -g vpk vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows --merge --releaseName "Sidekick v$version" --tag v$version + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} - name: ClickOnce - Git Key uses: webfactory/ssh-agent@v0.7.0 diff --git a/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj b/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj index eb3b7e216..f5e5580e1 100644 --- a/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj +++ b/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj @@ -7,7 +7,7 @@ - + From b3fe300cdcabd459deb692fdc983ab105c8e46bb Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 18:49:21 -0500 Subject: [PATCH 20/36] Update workflows --- .github/workflows/beta.yml | 47 +++++++++++------------- .github/workflows/release.yml | 45 ++++++++++------------- src/Sidekick.Apis.GitHub/GitHubClient.cs | 4 +- 3 files changed, 43 insertions(+), 53 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 68f4b4d50..251b7f0b4 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -80,7 +80,7 @@ jobs: Write-Output "Version: $version" dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build - dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained false -r win-x64 -o ./Publish + dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained true -r win-x64 -o ./Publish - name: Velopack shell: pwsh @@ -89,9 +89,9 @@ jobs: Write-Output "Version: $version" dotnet tool install -g vpk - vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta - vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} + vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel Windows-Beta + vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel Windows-Beta + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel Windows-Beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} - name: ClickOnce - Git Key uses: webfactory/ssh-agent@v0.7.0 @@ -114,32 +114,27 @@ jobs: -prerelease | select-object -first 1 Push-Location "src/Sidekick.Wpf" - & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version + & $msBuildPath src/Sidekick.Wpf/Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version Pop-Location $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Beta.git" Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "dist" - - Push-Location "dist" - try { - Write-Output "Removing previous files..." - if (Test-Path "Application Files") { - Remove-Item -Path "Application Files" -Recurse - } - if (Test-Path "Sidekick.application") { - Remove-Item -Path "Sidekick.application" - } - - Write-Output "Copying new files..." - Copy-Item -Path "../src/Sidekick.Wpf/bin/publish/Application Files","../src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination . -Recurse - - # Stage and commit. - git add -A - git commit -m "Update to v$version" - # git push - } finally { - Pop-Location + git clone $deployRepository -b gh-pages --single-branch "ClickOnce" + + Write-Output "Removing previous files..." + if (Test-Path "Application Files") { + Remove-Item -Path "ClickOnce/Application Files" -Recurse + } + if (Test-Path "Sidekick.application") { + Remove-Item -Path "ClickOnce/Sidekick.application" } + + Write-Output "Copying new files..." + Copy-Item -Path "./src/Sidekick.Wpf/bin/publish/Application Files","./src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination ./ClickOnce -Recurse + + # Stage and commit. + git add -A + git commit -m "Update to v$version" + # git push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 078d50a6e..a6ca19957 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,7 @@ jobs: Write-Output "Version: $version" dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build - dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained false -r win-x64 -o ./Publish + dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained true -r win-x64 -o ./Publish - name: Velopack shell: pwsh @@ -86,9 +86,9 @@ jobs: Write-Output "Version: $version" dotnet tool install -g vpk - vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows - vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} + vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel Windows-Stable + vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel Windows-Stable + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel Windows-Stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} - name: ClickOnce - Git Key uses: webfactory/ssh-agent@v0.7.0 @@ -118,25 +118,20 @@ jobs: Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "dist" - - Push-Location "dist" - try { - Write-Output "Removing previous files..." - if (Test-Path "Application Files") { - Remove-Item -Path "Application Files" -Recurse - } - if (Test-Path "Sidekick.application") { - Remove-Item -Path "Sidekick.application" - } - - Write-Output "Copying new files..." - Copy-Item -Path "../src/Sidekick.Wpf/bin/publish/Application Files","../src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination . -Recurse - - # Stage and commit. - git add -A - git commit -m "Update to v$version" - # git push - } finally { - Pop-Location + git clone $deployRepository -b gh-pages --single-branch "ClickOnce" + + Write-Output "Removing previous files..." + if (Test-Path "ClickOnce/Application Files") { + Remove-Item -Path "ClickOnce/Application Files" -Recurse + } + if (Test-Path "ClickOnce/Sidekick.application") { + Remove-Item -Path "ClickOnce/Sidekick.application" } + + Write-Output "Copying new files..." + Copy-Item -Path "./src/Sidekick.Wpf/bin/publish/Application Files","./src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination ./ClickOnce -Recurse + + # Stage and commit. + git add -A + git commit -m "Update to v$version" + # git push diff --git a/src/Sidekick.Apis.GitHub/GitHubClient.cs b/src/Sidekick.Apis.GitHub/GitHubClient.cs index 9f3c75313..32a8f82b1 100644 --- a/src/Sidekick.Apis.GitHub/GitHubClient.cs +++ b/src/Sidekick.Apis.GitHub/GitHubClient.cs @@ -7,7 +7,6 @@ using Sidekick.Apis.GitHub.Api; using Sidekick.Apis.GitHub.Models; using Sidekick.Common; -using Sidekick.Common.Cache; namespace Sidekick.Apis.GitHub; @@ -27,7 +26,8 @@ ILogger logger public Task Initialize() { - return DownloadGitHubDownloadIndicatorFile(); + return Task.CompletedTask; + // return DownloadGitHubDownloadIndicatorFile(); } /// From 32307f0594f938cc83a28c6ba91ba76a5a94ef8d Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 19:02:43 -0500 Subject: [PATCH 21/36] Updated workflows --- .github/workflows/beta.yml | 14 ++++++++++---- .github/workflows/release.yml | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 251b7f0b4..eb4c2085c 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -38,7 +38,13 @@ jobs: file: "src/**/*.csproj" version: ${{ steps.version.outputs.version }} - - name: Release Notes + - name: Release - Delete previous assets + uses: andreaswilli/delete-release-assets-action@ + with: + github_token: ${{ github.token }} + tag: 'v${{ steps.version.outputs.version }}' + + - name: Release - Notes uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ github.token }} @@ -89,9 +95,9 @@ jobs: Write-Output "Version: $version" dotnet tool install -g vpk - vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel Windows-Beta - vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel Windows-Beta - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel Windows-Beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} + vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta + vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} - name: ClickOnce - Git Key uses: webfactory/ssh-agent@v0.7.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6ca19957..7519d032a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,13 @@ jobs: file: "src/**/*.csproj" version: ${{ steps.version.outputs.version }} - - name: Release Notes + - name: Release - Delete previous assets + uses: andreaswilli/delete-release-assets-action@ + with: + github_token: ${{ github.token }} + tag: 'v${{ steps.version.outputs.version }}' + + - name: Release - Notes uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ github.token }} @@ -86,9 +92,9 @@ jobs: Write-Output "Version: $version" dotnet tool install -g vpk - vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel Windows-Stable - vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel Windows-Stable - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel Windows-Stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} + vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable + vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-stable + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} - name: ClickOnce - Git Key uses: webfactory/ssh-agent@v0.7.0 From 77e09f68eccfb98687884d2107be8ed007242a35 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 19:06:48 -0500 Subject: [PATCH 22/36] Updated workflows --- .github/workflows/beta.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index eb4c2085c..53bbcf5a3 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -39,7 +39,7 @@ jobs: version: ${{ steps.version.outputs.version }} - name: Release - Delete previous assets - uses: andreaswilli/delete-release-assets-action@ + uses: andreaswilli/delete-release-assets-action@v4.0.0 with: github_token: ${{ github.token }} tag: 'v${{ steps.version.outputs.version }}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7519d032a..b732b21fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: version: ${{ steps.version.outputs.version }} - name: Release - Delete previous assets - uses: andreaswilli/delete-release-assets-action@ + uses: andreaswilli/delete-release-assets-action@v4.0.0 with: github_token: ${{ github.token }} tag: 'v${{ steps.version.outputs.version }}' From 51eb48eb52434f095d9469de0bbf42da2b07f631 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 19:25:00 -0500 Subject: [PATCH 23/36] Updated workflows --- .github/workflows/beta.yml | 6 ++++-- .github/workflows/release.yml | 6 ++++-- README.md | 21 +++++++++------------ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 53bbcf5a3..dd418104f 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -22,8 +22,10 @@ jobs: # Get the current date $DATE = Get-Date -Format "yyyy.Md" - # Get the current time in hours and minutes (24-hour format) - $TIME = Get-Date -Format "Hmm" + # Get the current hour and minute without leading zero for the hour + $HOUR = [int](Get-Date -Format "HH") # Convert to integer to remove any leading zero + $MINUTE = Get-Date -Format "mm" + $TIME = "$HOUR$MINUTE" # Construct the version using DATE and TIME $VERSION = "$DATE.$TIME" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b732b21fb..942f54db0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,8 +19,10 @@ jobs: # Get the current date $DATE = Get-Date -Format "yyyy.Md" - # Get the current time in hours and minutes (24-hour format) - $TIME = Get-Date -Format "Hmm" + # Get the current hour and minute without leading zero for the hour + $HOUR = [int](Get-Date -Format "HH") # Convert to integer to remove any leading zero + $MINUTE = Get-Date -Format "mm" + $TIME = "$HOUR$MINUTE" # Construct the version using DATE and TIME $VERSION = "$DATE.$TIME" diff --git a/README.md b/README.md index b3b688b8f..e3f15736a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # [![](https://sidekick-poe.github.io/assets/images/orb_exalted.png)](#) Sidekick -[![Open Website](https://img.shields.io/badge/website-6b6ebe?style=flat-square)](https://sidekick-poe.github.io/) [![Download](https://img.shields.io/badge/download-00BCD4?style=flat-square)](https://sidekick-poe.github.io/) [![](https://img.shields.io/github/v/release/Sidekick-Poe/Sidekick?style=flat-square)](https://github.com/Sidekick-Poe/Sidekick/releases) [![Download Statistics](https://img.shields.io/github/downloads-pre/Sidekick-Poe/Sidekick/latest/total?style=flat-square&color=15803d)](https://tooomm.github.io/github-release-stats/?username=Sidekick-Poe&repository=Sidekick) [![Download Statistics](https://img.shields.io/github/downloads-pre/Sidekick-Poe/Sidekick/total?style=flat-square&color=22c55e)](https://tooomm.github.io/github-release-stats/?username=Sidekick-Poe&repository=Sidekick) [![](https://img.shields.io/discord/664252463188279300?color=%23738AD6&label=Discord&style=flat-square)](https://discord.gg/H4bg4GQ) +[![](https://img.shields.io/github/v/release/Sidekick-Poe/Sidekick?style=flat-square)](https://github.com/Sidekick-Poe/Sidekick/releases/latest) [![Download Statistics](https://img.shields.io/github/downloads-pre/Sidekick-Poe/Sidekick/latest/total?style=flat-square&color=15803d)](https://tooomm.github.io/github-release-stats/?username=Sidekick-Poe&repository=Sidekick) [![Download Statistics](https://img.shields.io/github/downloads-pre/Sidekick-Poe/Sidekick/total?style=flat-square&color=22c55e)](https://tooomm.github.io/github-release-stats/?username=Sidekick-Poe&repository=Sidekick) [![](https://img.shields.io/discord/664252463188279300?color=%23738AD6&label=Discord&style=flat-square)](https://discord.gg/H4bg4GQ) A Path of Exile companion tool. Price check items, check for dangerous map modifiers, and more! -[![Website](https://img.shields.io/badge/Website_and_Download-6b6ebe?style=for-the-badge)](https://sidekick-poe.github.io/) +[![Website](https://img.shields.io/badge/Website-6b6ebe?style=for-the-badge)](https://sidekick-poe.github.io/) [![Website](https://img.shields.io/badge/Download-00BCD4?style=for-the-badge)](https://github.com/Sidekick-Poe/Sidekick/releases/latest) [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/sidekickpoe) @@ -12,19 +12,16 @@ A Path of Exile companion tool. Price check items, check for dangerous map modif Sidekick now supports Path of Exile 2, and of course still supports Path of Exile 1. ## Development -To run the code: - +We accept most PR and ideas. If you want a feature included, create an issue and we will discuss it. We are also available on [Discord](https://discord.gg/H4bg4GQ). +#### Running the code: 1. Install **.NET SDK** -2. Install **NPM** (for the stylesheets) +2. Install **Node** and **NPM** (for the stylesheets) 3. Clone the repository -4. Open **.sln** with **Visual Studio 2022** or open the folder with **Visual Studio Code** -5. Choose to run **WPF** (vs2022 only) or **Web** version. Can also be done with **dotnet CLI** - -The interface is done in Blazor, running in a webview2 provided by WPF. For Linux, you can run the web project in your browser. - -We accept most PR and ideas. If you want a feature included, create an issue and we will discuss it. +4. Open **.sln** with your IDE of choice. Recommended IDEs are: **Visual Studio 2022**, **Rider** or **Visual Studio Code** +5. Run the **WPF** project (VS2022 or Rider) or **Web** project. Can also be done with **dotnet CLI** -We are also available on [Discord](https://discord.gg/H4bg4GQ). +#### Implementation Notes +The application is a web application that is running inside a WebView2 provided by WPF. Development can also be done using the Web project. ## Notice This product isn't affiliated with or endorsed by Grinding Gear Games in any way. From b236ba8de1fe7ca14e0f0d973116c2433b2f9c42 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 19:44:38 -0500 Subject: [PATCH 24/36] Updated workflows --- .github/workflows/beta.yml | 15 ++++++++++++--- .github/workflows/release.yml | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index dd418104f..0f015fe28 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -23,10 +23,19 @@ jobs: $DATE = Get-Date -Format "yyyy.Md" # Get the current hour and minute without leading zero for the hour - $HOUR = [int](Get-Date -Format "HH") # Convert to integer to remove any leading zero - $MINUTE = Get-Date -Format "mm" + # Get the current hour and minute + $HOUR = [int](Get-Date -Format "HH") # Convert hour to integer to strip any leading zero + + # If the hour is 0 (midnight), set it to an empty string + if ($HOUR -eq 0) { + $HOUR = '' + } + + $MINUTE = Get-Date -Format "mm" # Keep minutes as-is + + # Construct the time, omitting hour if it's empty $TIME = "$HOUR$MINUTE" - + # Construct the version using DATE and TIME $VERSION = "$DATE.$TIME" Write-Output "Generated version: $VERSION" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 942f54db0..3e038428b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,10 +20,19 @@ jobs: $DATE = Get-Date -Format "yyyy.Md" # Get the current hour and minute without leading zero for the hour - $HOUR = [int](Get-Date -Format "HH") # Convert to integer to remove any leading zero - $MINUTE = Get-Date -Format "mm" + # Get the current hour and minute + $HOUR = [int](Get-Date -Format "HH") # Convert hour to integer to strip any leading zero + + # If the hour is 0 (midnight), set it to an empty string + if ($HOUR -eq 0) { + $HOUR = '' + } + + $MINUTE = Get-Date -Format "mm" # Keep minutes as-is + + # Construct the time, omitting hour if it's empty $TIME = "$HOUR$MINUTE" - + # Construct the version using DATE and TIME $VERSION = "$DATE.$TIME" Write-Output "Generated version: $VERSION" From c5c7f1331b6251ba7532c95d3beaec408bb4a0f4 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 20:17:44 -0500 Subject: [PATCH 25/36] Updated workflows --- .github/workflows/beta.yml | 64 +++++++++++++++++------------- .github/workflows/release.yml | 73 ++++++++++++++++++++++------------- 2 files changed, 84 insertions(+), 53 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 0f015fe28..6ceb302e2 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -49,11 +49,10 @@ jobs: file: "src/**/*.csproj" version: ${{ steps.version.outputs.version }} - - name: Release - Delete previous assets - uses: andreaswilli/delete-release-assets-action@v4.0.0 - with: - github_token: ${{ github.token }} - tag: 'v${{ steps.version.outputs.version }}' + - name: Release - Delete unpublished + uses: hugo19941994/delete-draft-releases@v1.0.0 + env: + GITHUB_TOKEN: ${{ github.token }} - name: Release - Notes uses: release-drafter/release-drafter@v6 @@ -108,6 +107,10 @@ jobs: dotnet tool install -g vpk vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta + + # Delete the nupkg file + Get-ChildItem -Path ./Releases -Filter *.nupkg -Recurse | Remove-Item -Force + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} - name: ClickOnce - Git Key @@ -121,37 +124,44 @@ jobs: $version = "${{ steps.version.outputs.version }}" Write-Output "Version: $version" - git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github - git config --global user.name github-actions - git config --global user.email github-actions@github.com - # Find MSBuild. $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` -prerelease | select-object -first 1 Push-Location "src/Sidekick.Wpf" - & $msBuildPath src/Sidekick.Wpf/Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version + & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version Pop-Location - - $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Beta.git" - Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. + git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github + git config --global user.name github-actions + git config --global user.email github-actions@github.com git clone $deployRepository -b gh-pages --single-branch "ClickOnce" - Write-Output "Removing previous files..." - if (Test-Path "Application Files") { - Remove-Item -Path "ClickOnce/Application Files" -Recurse - } - if (Test-Path "Sidekick.application") { - Remove-Item -Path "ClickOnce/Sidekick.application" - } - - Write-Output "Copying new files..." - Copy-Item -Path "./src/Sidekick.Wpf/bin/publish/Application Files","./src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination ./ClickOnce -Recurse + $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Beta.git" + Write-Output "Deploy repository: $deployRepository" - # Stage and commit. - git add -A - git commit -m "Update to v$version" - # git push + # Clone `gh-pages` branch. + git clone $deployRepository -b gh-pages --single-branch "dist" + + Push-Location "dist" + try { + Write-Output "Removing previous files..." + if (Test-Path "Application Files") { + Remove-Item -Path "Application Files" -Recurse + } + if (Test-Path "Sidekick.application") { + Remove-Item -Path "Sidekick.application" + } + + Write-Output "Copying new files..." + Copy-Item -Path "../src/Sidekick.Wpf/bin/publish/Application Files","../src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination . -Recurse + + # Stage and commit. + git add -A + git commit -m "Update to v$version" + # git push + } finally { + Pop-Location + } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e038428b..02610bd6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,11 +46,10 @@ jobs: file: "src/**/*.csproj" version: ${{ steps.version.outputs.version }} - - name: Release - Delete previous assets - uses: andreaswilli/delete-release-assets-action@v4.0.0 - with: - github_token: ${{ github.token }} - tag: 'v${{ steps.version.outputs.version }}' + - name: Release - Delete unpublished + uses: hugo19941994/delete-draft-releases@v1.0.0 + env: + GITHUB_TOKEN: ${{ github.token }} - name: Release - Notes uses: release-drafter/release-drafter@v6 @@ -105,6 +104,10 @@ jobs: dotnet tool install -g vpk vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-stable + + # Delete the nupkg file + Get-ChildItem -Path ./Releases -Filter *.nupkg -Recurse | Remove-Item -Force + vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} - name: ClickOnce - Git Key @@ -118,37 +121,55 @@ jobs: $version = "${{ steps.version.outputs.version }}" Write-Output "Version: $version" - git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github - git config --global user.name github-actions - git config --global user.email github-actions@github.com - # Find MSBuild. $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` -prerelease | select-object -first 1 Push-Location "src/Sidekick.Wpf" - & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version + & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceRelease /property:ApplicationVersion=$version Pop-Location - - $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Beta.git" - Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. + git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github + git config --global user.name github-actions + git config --global user.email github-actions@github.com git clone $deployRepository -b gh-pages --single-branch "ClickOnce" - Write-Output "Removing previous files..." - if (Test-Path "ClickOnce/Application Files") { - Remove-Item -Path "ClickOnce/Application Files" -Recurse - } - if (Test-Path "ClickOnce/Sidekick.application") { - Remove-Item -Path "ClickOnce/Sidekick.application" - } + $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Release.git" + Write-Output "Deploy repository: $deployRepository" - Write-Output "Copying new files..." - Copy-Item -Path "./src/Sidekick.Wpf/bin/publish/Application Files","./src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination ./ClickOnce -Recurse + # Clone `gh-pages` branch. + git clone $deployRepository -b gh-pages --single-branch "dist" + + Push-Location "dist" + try { + Write-Output "Removing previous files..." + if (Test-Path "Application Files") { + Remove-Item -Path "Application Files" -Recurse + } + if (Test-Path "Sidekick.application") { + Remove-Item -Path "Sidekick.application" + } + + Write-Output "Copying new files..." + Copy-Item -Path "../src/Sidekick.Wpf/bin/publish/Application Files","../src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination . -Recurse + + # Stage and commit. + git add -A + git commit -m "Update to v$version" + git push + } finally { + Pop-Location + } - # Stage and commit. - git add -A - git commit -m "Update to v$version" - # git push + - name: Release - Download Instructions + uses: xresloader/upload-to-github-release@v1.3.4 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + file: 'download-instructions.txt' + tag_name: 'v${{ steps.version.outputs.version }}' + draft: true + verbose: true + overwrite: true From 1ddf169a670e1c57eb3c0106bf92dabd7748fb91 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 20:36:42 -0500 Subject: [PATCH 26/36] Updated workflows --- .github/workflows/beta.yml | 16 ++++++++++++---- .github/workflows/release.yml | 4 ---- src/Sidekick.Apis.GitHub/GitHubClient.cs | 3 +-- .../Components/Update.razor | 3 --- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 6ceb302e2..a4d81d399 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -55,6 +55,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} - name: Release - Notes + id: release uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ github.token }} @@ -107,10 +108,6 @@ jobs: dotnet tool install -g vpk vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta - - # Delete the nupkg file - Get-ChildItem -Path ./Releases -Filter *.nupkg -Recurse | Remove-Item -Force - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} - name: ClickOnce - Git Key @@ -165,3 +162,14 @@ jobs: } finally { Pop-Location } + + - name: Release - Download Instructions + uses: xresloader/upload-to-github-release@v1.3.4 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + file: 'download-instructions.txt' + tag_name: 'v${{ steps.version.outputs.version }}' + draft: true + verbose: true + overwrite: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02610bd6c..df6939732 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,10 +104,6 @@ jobs: dotnet tool install -g vpk vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-stable - - # Delete the nupkg file - Get-ChildItem -Path ./Releases -Filter *.nupkg -Recurse | Remove-Item -Force - vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} - name: ClickOnce - Git Key diff --git a/src/Sidekick.Apis.GitHub/GitHubClient.cs b/src/Sidekick.Apis.GitHub/GitHubClient.cs index 32a8f82b1..d72173c3d 100644 --- a/src/Sidekick.Apis.GitHub/GitHubClient.cs +++ b/src/Sidekick.Apis.GitHub/GitHubClient.cs @@ -26,8 +26,7 @@ ILogger logger public Task Initialize() { - return Task.CompletedTask; - // return DownloadGitHubDownloadIndicatorFile(); + return DownloadGitHubDownloadIndicatorFile(); } /// diff --git a/src/Sidekick.Common.Updater/Components/Update.razor b/src/Sidekick.Common.Updater/Components/Update.razor index 34ccef2f9..572977b00 100644 --- a/src/Sidekick.Common.Updater/Components/Update.razor +++ b/src/Sidekick.Common.Updater/Components/Update.razor @@ -91,9 +91,6 @@ Logger.LogError(ex.Message); Error = true; StateHasChanged(); - - await Task.Delay(1500); - NavigationManager.NavigateTo("/setup"); } } } From 9e00cac6e08a2070b43daf9865b261f2cf5d140a Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 20:52:12 -0500 Subject: [PATCH 27/36] Updated workflows --- .github/workflows/beta.yml | 14 ++++++++++++-- .github/workflows/release.yml | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index a4d81d399..f4f6f2925 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -121,6 +121,8 @@ jobs: $version = "${{ steps.version.outputs.version }}" Write-Output "Version: $version" + dotnet clean + # Find MSBuild. $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` @@ -140,9 +142,9 @@ jobs: Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "dist" + git clone $deployRepository -b gh-pages --single-branch "ClickOnce" - Push-Location "dist" + Push-Location "ClickOnce" try { Write-Output "Removing previous files..." if (Test-Path "Application Files") { @@ -173,3 +175,11 @@ jobs: draft: true verbose: true overwrite: true + + - name: Release - Remove .nupkg + uses: flcdrg/remove-release-asset-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + release_id: ${{ steps.release.outputs.id }} + asset_name: Sidekick-${{ steps.version.outputs.version }}-windows-beta-full.nupkg diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df6939732..a5c01a6d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,6 +117,8 @@ jobs: $version = "${{ steps.version.outputs.version }}" Write-Output "Version: $version" + dotnet clean + # Find MSBuild. $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` @@ -136,9 +138,9 @@ jobs: Write-Output "Deploy repository: $deployRepository" # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "dist" + git clone $deployRepository -b gh-pages --single-branch "ClickOnce" - Push-Location "dist" + Push-Location "ClickOnce" try { Write-Output "Removing previous files..." if (Test-Path "Application Files") { @@ -169,3 +171,11 @@ jobs: draft: true verbose: true overwrite: true + + - name: Release - Remove .nupkg + uses: flcdrg/remove-release-asset-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + release_id: ${{ steps.release.outputs.id }} + asset_name: Sidekick-${{ steps.version.outputs.version }}-windows-stable-full.nupkg From 66c47af3d5b21c4f14e2201426cd69296ce85ef7 Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 21:21:59 -0500 Subject: [PATCH 28/36] Removed clickonce tasks --- .github/workflows/beta.yml | 66 ----------------------------------- .github/workflows/release.yml | 66 ----------------------------------- 2 files changed, 132 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index f4f6f2925..75381fd91 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -110,72 +110,6 @@ jobs: vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} - - name: ClickOnce - Git Key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.DEPLOY_BETA_KEY }} - - - name: ClickOnce - shell: pwsh - run: | - $version = "${{ steps.version.outputs.version }}" - Write-Output "Version: $version" - - dotnet clean - - # Find MSBuild. - $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` - -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` - -prerelease | select-object -first 1 - - Push-Location "src/Sidekick.Wpf" - & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version - Pop-Location - - # Clone `gh-pages` branch. - git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github - git config --global user.name github-actions - git config --global user.email github-actions@github.com - git clone $deployRepository -b gh-pages --single-branch "ClickOnce" - - $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Beta.git" - Write-Output "Deploy repository: $deployRepository" - - # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "ClickOnce" - - Push-Location "ClickOnce" - try { - Write-Output "Removing previous files..." - if (Test-Path "Application Files") { - Remove-Item -Path "Application Files" -Recurse - } - if (Test-Path "Sidekick.application") { - Remove-Item -Path "Sidekick.application" - } - - Write-Output "Copying new files..." - Copy-Item -Path "../src/Sidekick.Wpf/bin/publish/Application Files","../src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination . -Recurse - - # Stage and commit. - git add -A - git commit -m "Update to v$version" - # git push - } finally { - Pop-Location - } - - - name: Release - Download Instructions - uses: xresloader/upload-to-github-release@v1.3.4 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - file: 'download-instructions.txt' - tag_name: 'v${{ steps.version.outputs.version }}' - draft: true - verbose: true - overwrite: true - - name: Release - Remove .nupkg uses: flcdrg/remove-release-asset-action@v1 env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5c01a6d3..87baa4d6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,72 +106,6 @@ jobs: vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-stable vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} - - name: ClickOnce - Git Key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.DEPLOY_BETA_KEY }} - - - name: ClickOnce - shell: pwsh - run: | - $version = "${{ steps.version.outputs.version }}" - Write-Output "Version: $version" - - dotnet clean - - # Find MSBuild. - $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` - -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` - -prerelease | select-object -first 1 - - Push-Location "src/Sidekick.Wpf" - & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceRelease /property:ApplicationVersion=$version - Pop-Location - - # Clone `gh-pages` branch. - git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github - git config --global user.name github-actions - git config --global user.email github-actions@github.com - git clone $deployRepository -b gh-pages --single-branch "ClickOnce" - - $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Release.git" - Write-Output "Deploy repository: $deployRepository" - - # Clone `gh-pages` branch. - git clone $deployRepository -b gh-pages --single-branch "ClickOnce" - - Push-Location "ClickOnce" - try { - Write-Output "Removing previous files..." - if (Test-Path "Application Files") { - Remove-Item -Path "Application Files" -Recurse - } - if (Test-Path "Sidekick.application") { - Remove-Item -Path "Sidekick.application" - } - - Write-Output "Copying new files..." - Copy-Item -Path "../src/Sidekick.Wpf/bin/publish/Application Files","../src/Sidekick.Wpf/bin/publish/Sidekick.application" -Destination . -Recurse - - # Stage and commit. - git add -A - git commit -m "Update to v$version" - git push - } finally { - Pop-Location - } - - - name: Release - Download Instructions - uses: xresloader/upload-to-github-release@v1.3.4 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - file: 'download-instructions.txt' - tag_name: 'v${{ steps.version.outputs.version }}' - draft: true - verbose: true - overwrite: true - - name: Release - Remove .nupkg uses: flcdrg/remove-release-asset-action@v1 env: From fcbfec674a3c86844a31cbf8a81895aa9dd05a9f Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 21:25:51 -0500 Subject: [PATCH 29/36] Updated workflows --- .github/workflows/beta.yml | 11 +++ .../{wpf-beta.yml => clickonce-beta.yml} | 10 +-- ...{wpf-release.yml => clickonce-release.yml} | 81 +------------------ .github/workflows/release.yml | 11 +++ Sidekick.sln | 4 +- 5 files changed, 30 insertions(+), 87 deletions(-) rename .github/workflows/{wpf-beta.yml => clickonce-beta.yml} (95%) rename .github/workflows/{wpf-release.yml => clickonce-release.yml} (57%) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 75381fd91..f90b0ba5f 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -110,6 +110,17 @@ jobs: vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} + - name: Release - Download Instructions + uses: xresloader/upload-to-github-release@v1.3.4 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + file: 'download-instructions.txt' + tag_name: 'v${{ steps.version.outputs.version }}' + draft: true + verbose: true + overwrite: true + - name: Release - Remove .nupkg uses: flcdrg/remove-release-asset-action@v1 env: diff --git a/.github/workflows/wpf-beta.yml b/.github/workflows/clickonce-beta.yml similarity index 95% rename from .github/workflows/wpf-beta.yml rename to .github/workflows/clickonce-beta.yml index 1f20d80d3..6b4fd6912 100644 --- a/.github/workflows/wpf-beta.yml +++ b/.github/workflows/clickonce-beta.yml @@ -1,4 +1,4 @@ -name: WPF Beta +name: ClickOnce Beta on: push: @@ -67,7 +67,7 @@ jobs: - name: Build - Sidekick.Protocol run: dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build - - name: Build - Sidekick.Wpf + - name: ClickOnce - Build shell: pwsh run: | $version = "${{ steps.version.outputs.version }}" @@ -82,18 +82,18 @@ jobs: & $msBuildPath Sidekick.Wpf.csproj /target:Publish /property:PublishProfile=ClickOnceBeta /property:ApplicationVersion=$version Pop-Location - - name: Git - Setup + - name: ClickOnce - Git Setup run: | git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github git config --global user.name github-actions git config --global user.email github-actions@github.com - - name: Git - Setup SSH + - name: ClickOnce - Git Setup SSH uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.DEPLOY_BETA_KEY }} - - name: Git - Push to repository + - name: ClickOnce - Git Push shell: pwsh run: | $deployRepository = "git@github.com:Sidekick-Poe/Sidekick-Beta.git" diff --git a/.github/workflows/wpf-release.yml b/.github/workflows/clickonce-release.yml similarity index 57% rename from .github/workflows/wpf-release.yml rename to .github/workflows/clickonce-release.yml index 28dad8e4c..6154b83d9 100644 --- a/.github/workflows/wpf-release.yml +++ b/.github/workflows/clickonce-release.yml @@ -1,4 +1,4 @@ -name: WPF Release +name: ClickOnce Release on: workflow_dispatch: @@ -47,17 +47,6 @@ jobs: name: GITHUB_TOKEN value: ${{ github.token }} - - name: Release - Notes - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - name: 'Sidekick v${{ steps.version.outputs.version }}' - tag: 'v${{ steps.version.outputs.version }}' - version: 'v${{ steps.version.outputs.version }}' - publish: false - prerelease: false - - name: .NET - Setup uses: actions/setup-dotnet@v1 with: @@ -130,71 +119,3 @@ jobs: } finally { Pop-Location } - - - name: Zip - Build - shell: pwsh - run: | - $version = "${{ steps.version.outputs.version }}" - Write-Output "Version: $version" - - # Define the publish path - $publishPath = "bin/zip-publish" - - # Remove existing files if the folder exists - if (Test-Path -Path $publishPath) { - Write-Output "Removing existing files from $publishPath..." - Remove-Item -Path $publishPath -Recurse -Force - } - - # Create the folder if it doesn't exist - if (!(Test-Path -Path $publishPath)) { - New-Item -ItemType Directory -Force -Path $publishPath | Out-Null - Write-Output "$publishPath created" - } - - # Find MSBuild. - $msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` - -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe ` - -prerelease | Select-Object -First 1 - - Push-Location "src/Sidekick.Wpf" - - # Run the build command with a self-contained mode - & $msBuildPath Sidekick.Wpf.csproj ` - /target:Publish ` - /property:PublishDir=$publishPath\ ` - /property:SelfContained=true ` - /property:ApplicationVersion=$version - - Pop-Location - - - name: Zip - Archive - shell: pwsh - run: | - $publishPath = "src/Sidekick.Wpf/bin/zip-publish" - $zipFilePath = "dist/Sidekick_v${{ steps.version.outputs.version }}.zip" - if (Test-Path -Path $zipFilePath) { - Remove-Item -Path $zipFilePath -Force - } - Compress-Archive -Path $publishPath\* -DestinationPath $zipFilePath - Write-Host "Files zipped successfully to $zipFilePath" - - - name: Release - Asset - uses: xresloader/upload-to-github-release@v1.3.4 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - file: 'download-instructions.txt' - tag_name: 'v${{ steps.version.outputs.version }}' - draft: true - verbose: true - overwrite: true - - - name: Release - Zip - uses: xresloader/upload-to-github-release@v1.3.4 - with: - file: 'dist/Sidekick_v${{ steps.version.outputs.version }}.zip' - tag_name: 'v${{ steps.version.outputs.version }}' - draft: true - verbose: true - overwrite: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87baa4d6f..94b633e87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,6 +106,17 @@ jobs: vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-stable vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} + - name: Release - Download Instructions + uses: xresloader/upload-to-github-release@v1.3.4 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + file: 'download-instructions.txt' + tag_name: 'v${{ steps.version.outputs.version }}' + draft: true + verbose: true + overwrite: true + - name: Release - Remove .nupkg uses: flcdrg/remove-release-asset-action@v1 env: diff --git a/Sidekick.sln b/Sidekick.sln index ccb75a519..8385a84a8 100644 --- a/Sidekick.sln +++ b/Sidekick.sln @@ -13,11 +13,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution", "_Solution", "{ LICENSE = LICENSE README.md = README.md .github\workflows\tests.yml = .github\workflows\tests.yml - .github\workflows\wpf-beta.yml = .github\workflows\wpf-beta.yml - .github\workflows\wpf-release.yml = .github\workflows\wpf-release.yml download-instructions.txt = download-instructions.txt .github\workflows\beta.yml = .github\workflows\beta.yml .github\workflows\release.yml = .github\workflows\release.yml + .github\workflows\clickonce-beta.yml = .github\workflows\clickonce-beta.yml + .github\workflows\clickonce-release.yml = .github\workflows\clickonce-release.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{E4920CFB-0EED-44B1-AC8D-8F5ECBCB7788}" From adce5d72e1887c126108c3acc60a529429e50b8b Mon Sep 17 00:00:00 2001 From: leMicin Date: Wed, 25 Dec 2024 23:58:45 -0500 Subject: [PATCH 30/36] Removed download instructions from the release assets --- .github/workflows/beta.yml | 11 ----- .github/workflows/release.yml | 11 ----- src/Sidekick.Common.Ui/wwwroot/css/app.css | 49 ---------------------- 3 files changed, 71 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index f90b0ba5f..75381fd91 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -110,17 +110,6 @@ jobs: vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} - - name: Release - Download Instructions - uses: xresloader/upload-to-github-release@v1.3.4 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - file: 'download-instructions.txt' - tag_name: 'v${{ steps.version.outputs.version }}' - draft: true - verbose: true - overwrite: true - - name: Release - Remove .nupkg uses: flcdrg/remove-release-asset-action@v1 env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94b633e87..87baa4d6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,17 +106,6 @@ jobs: vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-stable vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} - - name: Release - Download Instructions - uses: xresloader/upload-to-github-release@v1.3.4 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - file: 'download-instructions.txt' - tag_name: 'v${{ steps.version.outputs.version }}' - draft: true - verbose: true - overwrite: true - - name: Release - Remove .nupkg uses: flcdrg/remove-release-asset-action@v1 env: diff --git a/src/Sidekick.Common.Ui/wwwroot/css/app.css b/src/Sidekick.Common.Ui/wwwroot/css/app.css index a2ba23115..eeb34fe6e 100644 --- a/src/Sidekick.Common.Ui/wwwroot/css/app.css +++ b/src/Sidekick.Common.Ui/wwwroot/css/app.css @@ -1508,11 +1508,6 @@ video { margin-bottom: 0px; } -.my-1 { - margin-top: 0.25rem; - margin-bottom: 0.25rem; -} - .my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; @@ -1544,10 +1539,6 @@ video { margin-bottom: 0.75rem; } -.mb-4 { - margin-bottom: 1rem; -} - .ml-0 { margin-left: 0px; } @@ -1572,22 +1563,10 @@ video { margin-left: auto; } -.mr-1 { - margin-right: 0.25rem; -} - .mr-2 { margin-right: 0.5rem; } -.mr-3 { - margin-right: 0.75rem; -} - -.mr-4 { - margin-right: 1rem; -} - .mt-1 { margin-top: 0.25rem; } @@ -1604,10 +1583,6 @@ video { margin-top: 1rem; } -.mt-6 { - margin-top: 1.5rem; -} - .mt-9 { margin-top: 2.25rem; } @@ -1940,10 +1915,6 @@ video { flex-grow: 1; } -.flex-grow-0 { - flex-grow: 0; -} - .grow { flex-grow: 1; } @@ -3343,10 +3314,6 @@ video { padding-bottom: 1rem; } -.pb-0 { - padding-bottom: 0px; -} - .pb-2 { padding-bottom: 0.5rem; } @@ -3367,10 +3334,6 @@ video { padding-bottom: 4px; } -.pl-12 { - padding-left: 3rem; -} - .pl-2 { padding-left: 0.5rem; } @@ -3387,22 +3350,10 @@ video { padding-right: 0.5rem; } -.pr-4 { - padding-right: 1rem; -} - -.pt-0 { - padding-top: 0px; -} - .pt-2 { padding-top: 0.5rem; } -.pt-4 { - padding-top: 1rem; -} - .pt-\[4px\] { padding-top: 4px; } From 5447fedd399b1ca68c3f1e4701ae503a7f193b3e Mon Sep 17 00:00:00 2001 From: leMicin Date: Sat, 28 Dec 2024 09:47:23 -0500 Subject: [PATCH 31/36] Added test label to the tray --- .../Initialization/Initialization.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs b/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs index 7b01ff657..76e7feffc 100644 --- a/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs +++ b/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs @@ -175,7 +175,7 @@ private void InitializeTray() menuItems.AddRange(new List() { - new(label: "Sidekick - " + GetVersion()), + new(label: "Sidekick Beta - " + GetVersion()), new(label: Resources["Open_Website"], onClick: () => { From 7016494b27e179ad86ad0071f7e5a3d0e9ca408a Mon Sep 17 00:00:00 2001 From: leMicin Date: Sat, 28 Dec 2024 09:51:23 -0500 Subject: [PATCH 32/36] Updated velopack version --- src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj b/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj index f5e5580e1..0c4a4759a 100644 --- a/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj +++ b/src/Sidekick.Common.Updater/Sidekick.Common.Updater.csproj @@ -7,7 +7,7 @@ - + From 27009d70d069d27d651f687836afb3f65f7b5767 Mon Sep 17 00:00:00 2001 From: leMicin Date: Sat, 28 Dec 2024 10:07:43 -0500 Subject: [PATCH 33/36] Include pre releases in version check --- .../Initialization/Initialization.razor.cs | 2 +- src/Sidekick.Common.Updater/AutoUpdater.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs b/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs index 76e7feffc..7b01ff657 100644 --- a/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs +++ b/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs @@ -175,7 +175,7 @@ private void InitializeTray() menuItems.AddRange(new List() { - new(label: "Sidekick Beta - " + GetVersion()), + new(label: "Sidekick - " + GetVersion()), new(label: Resources["Open_Website"], onClick: () => { diff --git a/src/Sidekick.Common.Updater/AutoUpdater.cs b/src/Sidekick.Common.Updater/AutoUpdater.cs index 09a5ac286..5ed617ce1 100644 --- a/src/Sidekick.Common.Updater/AutoUpdater.cs +++ b/src/Sidekick.Common.Updater/AutoUpdater.cs @@ -8,7 +8,7 @@ public class AutoUpdater( { public async Task CheckForUpdates() { - var source = new Velopack.Sources.GithubSource("https://github.com/Sidekick-Poe/Sidekick", null, false); + var source = new Velopack.Sources.GithubSource("https://github.com/Sidekick-Poe/Sidekick", null, true); var updateManager = new UpdateManager(source); logger.LogInformation("[AutoUpdater] Checking for updates."); From 25ecedee5955faf44c013a1b59e5355490f41d20 Mon Sep 17 00:00:00 2001 From: leMicin Date: Sat, 28 Dec 2024 10:29:31 -0500 Subject: [PATCH 34/36] Added back the nupkg asset required for the update --- .github/workflows/beta.yml | 8 -------- .github/workflows/release.yml | 8 -------- src/Sidekick.Common.Updater/AutoUpdater.cs | 2 +- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 75381fd91..66192f010 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -109,11 +109,3 @@ jobs: vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }} - - - name: Release - Remove .nupkg - uses: flcdrg/remove-release-asset-action@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - release_id: ${{ steps.release.outputs.id }} - asset_name: Sidekick-${{ steps.version.outputs.version }}-windows-beta-full.nupkg diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87baa4d6f..64d86c5d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,11 +105,3 @@ jobs: vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-stable vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-stable --merge --releaseName "Sidekick v$version" --tag v$version${{ github.token }} - - - name: Release - Remove .nupkg - uses: flcdrg/remove-release-asset-action@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - release_id: ${{ steps.release.outputs.id }} - asset_name: Sidekick-${{ steps.version.outputs.version }}-windows-stable-full.nupkg diff --git a/src/Sidekick.Common.Updater/AutoUpdater.cs b/src/Sidekick.Common.Updater/AutoUpdater.cs index 5ed617ce1..03a148bd1 100644 --- a/src/Sidekick.Common.Updater/AutoUpdater.cs +++ b/src/Sidekick.Common.Updater/AutoUpdater.cs @@ -9,7 +9,7 @@ public class AutoUpdater( public async Task CheckForUpdates() { var source = new Velopack.Sources.GithubSource("https://github.com/Sidekick-Poe/Sidekick", null, true); - var updateManager = new UpdateManager(source); + var updateManager = new UpdateManager(source, logger: logger); logger.LogInformation("[AutoUpdater] Checking for updates."); var newVersion = await updateManager.CheckForUpdatesAsync(); From 6350bb22219f353febf1af57715c025c6a8d69c1 Mon Sep 17 00:00:00 2001 From: leMicin Date: Sat, 28 Dec 2024 10:33:27 -0500 Subject: [PATCH 35/36] Added beta text for test --- .../Initialization/Initialization.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs b/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs index 7b01ff657..76e7feffc 100644 --- a/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs +++ b/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs @@ -175,7 +175,7 @@ private void InitializeTray() menuItems.AddRange(new List() { - new(label: "Sidekick - " + GetVersion()), + new(label: "Sidekick Beta - " + GetVersion()), new(label: Resources["Open_Website"], onClick: () => { From 1c5e012b54533ddda6df3b595f9fd06f813704d3 Mon Sep 17 00:00:00 2001 From: leMicin Date: Sat, 28 Dec 2024 10:40:17 -0500 Subject: [PATCH 36/36] Removed beta text --- .../Initialization/Initialization.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs b/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs index 76e7feffc..7b01ff657 100644 --- a/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs +++ b/src/Sidekick.Common.Blazor/Initialization/Initialization.razor.cs @@ -175,7 +175,7 @@ private void InitializeTray() menuItems.AddRange(new List() { - new(label: "Sidekick Beta - " + GetVersion()), + new(label: "Sidekick - " + GetVersion()), new(label: Resources["Open_Website"], onClick: () => {