From 7f887f55e1b1afcdffcb11c4ff8c98c1109af5d8 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 13:23:17 -0500 Subject: [PATCH 01/14] add github action --- .github/workflows/dotnet.yml | 96 ++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000000..f33418e9a51 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,96 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Build + +on: + workflow_dispatch: + push: + branches: + - dev + - master + pull_request: + +jobs: + build: + + runs-on: windows-latest + env: + FlowVersion: 1.19.5 + NUGET_CERT_REVOCATION_MODE: offline + BUILD_NUMBER: ${{ github.run_number }} + steps: + - uses: actions/checkout@v4 + - name: Set Flow.Launcher.csproj version + id: update + uses: vers-one/dotnet-project-version-updater@v1.5 + with: + file: | + "**/SolutionAssemblyInfo.cs" + version: ${{ env.FlowVersion }}.${{ env.BUILD_NUMBER }} + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 7.0.x +# cache: true +# cache-dependency-path: | +# Flow.Launcher/packages.lock.json +# Flow.Launcher.Core/packages.lock.json +# Flow.Launcher.Infrastructure/packages.lock.json +# Flow.Launcher.Plugin/packages.lock.json + - name: Install vpk + Install vpk tool (dotnet tool install will not reinstall if already installed) + We will update the cli by removing cache + run: | + if (!(Get-Command vpk -ErrorAction SilentlyContinue)) { + dotnet tool install -g vpk + } + - name: Restore dependencies + run: dotnet restore --locked-mode + - name: Build + run: dotnet build --no-restore -c Release + - name: Initialize Service + run: | + sc config WSearch start= auto # Starts Windows Search service- Needed for running ExplorerTest + net start WSearch + - name: Test + run: dotnet test --no-build --verbosity normal -c Release + - name: Perform post_build tasks + shell: pwsh + run: .\Scripts\post_build.ps1 -flowversion "${env:FlowVersion}-build.${env:BUILD_NUMBER}" + - name: Upload Plugin Nupkg + uses: actions/upload-artifact@v4 + with: + name: Plugin nupkg + path: | + Output\Release\Flow.Launcher.Plugin.*.nupkg + compression-level: 0 + - name: Upload Setup + uses: actions/upload-artifact@v4 + with: + name: Flow Installer + path: | + Output\Packages\Flow-Launcher-*.exe + compression-level: 0 + - name: Upload Portable Version + uses: actions/upload-artifact@v4 + with: + name: Portable Version + path: | + Output\Packages\Flow-Launcher-Portable.zip + compression-level: 0 + - name: Upload Full Nupkg + uses: actions/upload-artifact@v4 + with: + name: Full nupkg + path: | + Output\Packages\FlowLauncher-*-full.nupkg + + compression-level: 0 + - name: Upload Release Information + uses: actions/upload-artifact@v4 + with: + name: RELEASES + path: | + Output\Packages\RELEASES + compression-level: 0 From 8a5b699d57d804bf312e4121b7fa8bf2211fcef2 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 13:25:05 -0500 Subject: [PATCH 02/14] update vpk install --- .github/workflows/dotnet.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f33418e9a51..d69e66ed877 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -39,12 +39,7 @@ jobs: # Flow.Launcher.Infrastructure/packages.lock.json # Flow.Launcher.Plugin/packages.lock.json - name: Install vpk - Install vpk tool (dotnet tool install will not reinstall if already installed) - We will update the cli by removing cache - run: | - if (!(Get-Command vpk -ErrorAction SilentlyContinue)) { - dotnet tool install -g vpk - } + run: dotnet tool install -g vpk - name: Restore dependencies run: dotnet restore --locked-mode - name: Build From cb47632ef57d848141ba6f77fcae60439551f519 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 16:14:13 -0500 Subject: [PATCH 03/14] remove unused argument --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d69e66ed877..2e4531645f2 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -52,7 +52,7 @@ jobs: run: dotnet test --no-build --verbosity normal -c Release - name: Perform post_build tasks shell: pwsh - run: .\Scripts\post_build.ps1 -flowversion "${env:FlowVersion}-build.${env:BUILD_NUMBER}" + run: .\Scripts\post_build.ps1 - name: Upload Plugin Nupkg uses: actions/upload-artifact@v4 with: From 9cd4e80a767d113ae518419517a34f5c28f3b67c Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 16:26:14 -0500 Subject: [PATCH 04/14] use nuget packages path and fix pwsh behavior --- Scripts/post_build.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 1757ed99e22..e6586b28012 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -33,14 +33,14 @@ function Build-Path { function Copy-Resources ($path) { # making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced. - Copy-Item -Force $env:USERPROFILE\.nuget\packages\squirrel.windows\1.5.2\tools\Squirrel.exe $path\Output\Update.exe + Copy-Item -Force $env:NUGET_PACKAGES\squirrel.windows\1.5.2\tools\Squirrel.exe $path\Output\Update.exe } function Delete-Unused ($path, $config) { $target = "$path\Output\$config" $included = Get-ChildItem $target -Filter "*.dll" foreach ($i in $included){ - $deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq "$i" } + $deleteList = Get-ChildItem $target\Plugins -Filter $i.Name -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } $deleteList | Remove-Item } @@ -72,14 +72,14 @@ function Pack-Squirrel-Installer ($path, $version, $output) { Write-Host "Input path: $input" # dotnet pack is not used because ran into issues, need to test installation and starting up if to use it. - nuget pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release + dotnet pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release $nupkg = "$output\FlowLauncher.$version.nupkg" Write-Host "nupkg path: $nupkg" $icon = "$path\Flow.Launcher\Resources\app.ico" Write-Host "icon: $icon" # Squirrel.com: https://github.com/Squirrel/Squirrel.Windows/issues/369 - New-Alias Squirrel $env:USERPROFILE\.nuget\packages\squirrel.windows\1.5.2\tools\Squirrel.exe -Force + New-Alias Squirrel $env:NUGET_PACKAGES\squirrel.windows\1.5.2\tools\Squirrel.exe -Force # why we need Write-Output: https://github.com/Squirrel/Squirrel.Windows/issues/489#issuecomment-156039327 # directory of releaseDir in squirrel can't be same as directory ($nupkg) in releasify $temp = "$output\Temp" From 0017971b3170f06d0a4d405a9a124f0d1841b9d2 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 16:39:50 -0500 Subject: [PATCH 05/14] revert nuget_packages enviromental variables --- Scripts/post_build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index e6586b28012..d324fd5aabc 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -33,7 +33,7 @@ function Build-Path { function Copy-Resources ($path) { # making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced. - Copy-Item -Force $env:NUGET_PACKAGES\squirrel.windows\1.5.2\tools\Squirrel.exe $path\Output\Update.exe + Copy-Item -Force $env:USERPROFILE\.nuget\packages\squirrel.windows\1.5.2\tools\Squirrel.exe $path\Output\Update.exe } function Delete-Unused ($path, $config) { @@ -79,7 +79,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) { $icon = "$path\Flow.Launcher\Resources\app.ico" Write-Host "icon: $icon" # Squirrel.com: https://github.com/Squirrel/Squirrel.Windows/issues/369 - New-Alias Squirrel $env:NUGET_PACKAGES\squirrel.windows\1.5.2\tools\Squirrel.exe -Force + New-Alias Squirrel $env:USERPROFILE\.nuget\packages\squirrel.windows\1.5.2\tools\Squirrel.exe -Force # why we need Write-Output: https://github.com/Squirrel/Squirrel.Windows/issues/489#issuecomment-156039327 # directory of releaseDir in squirrel can't be same as directory ($nupkg) in releasify $temp = "$output\Temp" From 01b4b27d82d5fb5af8aad67454e9cf66ae3a3cf1 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 16:48:35 -0500 Subject: [PATCH 06/14] revert dotnet pack --- Scripts/post_build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index d324fd5aabc..84b9a387714 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -72,7 +72,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) { Write-Host "Input path: $input" # dotnet pack is not used because ran into issues, need to test installation and starting up if to use it. - dotnet pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release + nuget pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release $nupkg = "$output\FlowLauncher.$version.nupkg" Write-Host "nupkg path: $nupkg" From cb839a15686eb6ee4794dc0c0b1302bf2652f9bc Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 17:01:57 -0500 Subject: [PATCH 07/14] ignore System.Text.Encodings.Web.dll --- Scripts/post_build.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 84b9a387714..6863edb5c6d 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -40,6 +40,10 @@ function Delete-Unused ($path, $config) { $target = "$path\Output\$config" $included = Get-ChildItem $target -Filter "*.dll" foreach ($i in $included){ + if ($i.Name in ["System.Text.Encodings.Web.dll"]) { + # ignore some specific dll that seems to make issue + continue + } $deleteList = Get-ChildItem $target\Plugins -Filter $i.Name -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } $deleteList | Remove-Item From a870e2773a2eeffdbced2c47842323f7c88dd8f1 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 17:07:33 -0500 Subject: [PATCH 08/14] fix ignore list --- Scripts/post_build.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 6863edb5c6d..40f102ab487 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -40,7 +40,9 @@ function Delete-Unused ($path, $config) { $target = "$path\Output\$config" $included = Get-ChildItem $target -Filter "*.dll" foreach ($i in $included){ - if ($i.Name in ["System.Text.Encodings.Web.dll"]) { + $ignored = ["System.Text.Encodings.Web.dll"] + + if ($ignored.Contains($i.Name)) { # ignore some specific dll that seems to make issue continue } From d770e6dbb5d39a1ac711728f790831fbc8c81089 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 17:08:55 -0500 Subject: [PATCH 09/14] try delete only the first level dll --- Scripts/post_build.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 40f102ab487..a10441026b0 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -46,9 +46,11 @@ function Delete-Unused ($path, $config) { # ignore some specific dll that seems to make issue continue } - $deleteList = Get-ChildItem $target\Plugins -Filter $i.Name -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } - $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } - $deleteList | Remove-Item + foreach ($plugin in Get-ChildItem $target\Plugins){ + $deleteList = Get-ChildItem $target\Plugins -Filter $i.Name | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } + $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } + $deleteList | Remove-Item + } } Remove-Item -Path $target -Include "*.xml" -Recurse } From 8e26a4c077f208ea835a2ca1ac81fac74e0b2ec4 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Mar 2025 22:37:23 -0500 Subject: [PATCH 10/14] delete only the first level dll --- Scripts/post_build.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index a10441026b0..81b6f3d4bcd 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -40,12 +40,6 @@ function Delete-Unused ($path, $config) { $target = "$path\Output\$config" $included = Get-ChildItem $target -Filter "*.dll" foreach ($i in $included){ - $ignored = ["System.Text.Encodings.Web.dll"] - - if ($ignored.Contains($i.Name)) { - # ignore some specific dll that seems to make issue - continue - } foreach ($plugin in Get-ChildItem $target\Plugins){ $deleteList = Get-ChildItem $target\Plugins -Filter $i.Name | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } From 2868c7256e570316255d41491916bd290ffc6cde Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Thu, 20 Mar 2025 10:29:34 -0500 Subject: [PATCH 11/14] fix path issue --- Scripts/post_build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 81b6f3d4bcd..6f610c99ea3 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -41,7 +41,7 @@ function Delete-Unused ($path, $config) { $included = Get-ChildItem $target -Filter "*.dll" foreach ($i in $included){ foreach ($plugin in Get-ChildItem $target\Plugins){ - $deleteList = Get-ChildItem $target\Plugins -Filter $i.Name | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } + $deleteList = Get-ChildItem $plugin -Filter $i.Name | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } $deleteList | Remove-Item } From f26d5632c8295c4c433e21315506cb9be92fe422 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Wed, 26 Mar 2025 22:01:53 -0500 Subject: [PATCH 12/14] use powershell and revert change in post_build.ps1 --- .github/workflows/dotnet.yml | 2 +- Scripts/post_build.ps1 | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2e4531645f2..3e986c60321 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -51,7 +51,7 @@ jobs: - name: Test run: dotnet test --no-build --verbosity normal -c Release - name: Perform post_build tasks - shell: pwsh + shell: powershell run: .\Scripts\post_build.ps1 - name: Upload Plugin Nupkg uses: actions/upload-artifact@v4 diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 6f610c99ea3..e54852d321b 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -1,5 +1,5 @@ param( - [string]$config = "Release", + [string]$config = "Release", [string]$solution = (Join-Path $PSScriptRoot ".." -Resolve) ) Write-Host "Config: $config" @@ -40,13 +40,11 @@ function Delete-Unused ($path, $config) { $target = "$path\Output\$config" $included = Get-ChildItem $target -Filter "*.dll" foreach ($i in $included){ - foreach ($plugin in Get-ChildItem $target\Plugins){ - $deleteList = Get-ChildItem $plugin -Filter $i.Name | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } - $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } - $deleteList | Remove-Item - } + $deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq "$i" } + $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } + $deleteList | Remove-Item } - Remove-Item -Path $target -Include "*.xml" -Recurse + Remove-Item -Path $target -Include "*.xml" -Recurse } function Remove-CreateDumpExe ($path, $config) { @@ -89,7 +87,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) { Squirrel --releasify $nupkg --releaseDir $temp --setupIcon $icon --no-msi | Write-Output Move-Item $temp\* $output -Force Remove-Item $temp - + $file = "$output\Flow-Launcher-Setup.exe" Write-Host "Filename: $file" @@ -109,7 +107,7 @@ function Publish-Self-Contained ($p) { } function Publish-Portable ($outputLocation, $version) { - + & $outputLocation\Flow-Launcher-Setup.exe --silent | Out-Null mkdir "$env:LocalAppData\FlowLauncher\app-$version\UserData" Compress-Archive -Path $env:LocalAppData\FlowLauncher -DestinationPath $outputLocation\Flow-Launcher-Portable.zip @@ -121,7 +119,7 @@ function Main { Copy-Resources $p if ($config -eq "Release"){ - + Delete-Unused $p $config Publish-Self-Contained $p @@ -136,4 +134,4 @@ function Main { } } -Main +Main \ No newline at end of file From 935ac77a09a8817674b31454362a70d327cc2546 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Wed, 26 Mar 2025 22:13:57 -0500 Subject: [PATCH 13/14] remove lock mode --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3e986c60321..52f8d9f7c31 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -41,7 +41,7 @@ jobs: - name: Install vpk run: dotnet tool install -g vpk - name: Restore dependencies - run: dotnet restore --locked-mode + run: dotnet restore - name: Build run: dotnet build --no-restore -c Release - name: Initialize Service From a1b1d84a8a33660fd243d7c6d7403296a79f290a Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Thu, 27 Mar 2025 11:57:49 -0500 Subject: [PATCH 14/14] try nuget restore --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 52f8d9f7c31..718a28dbdf5 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -41,7 +41,7 @@ jobs: - name: Install vpk run: dotnet tool install -g vpk - name: Restore dependencies - run: dotnet restore + run: nuget restore - name: Build run: dotnet build --no-restore -c Release - name: Initialize Service