diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000000..471058be5ca --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,81 @@ +# 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: .NET + +on: + workflow_dispatch: + +jobs: + build: + + runs-on: windows-latest + + steps: + - name: Initialize Service + run: | + sc config WSearch start= auto # Starts Windows Search service- Needed for running ExplorerTest + net start WSearch + - name: Set version in all AssemblyInfo.cs files + uses: secondbounce/assemblyinfo-update@v2 + with: + version: '1.9.5' + - if: ${{ runner.os == 'Windows' }} + name: Use GNU tar + shell: cmd + run: | + echo "Adding GNU tar to PATH" + echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" + - uses: actions/cache@v3 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + restore-keys: | + ${{ runner.os }}-nuget- + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore -c Release + - name: Perform a Pester test from the command-line + shell: pwsh + run: .\Scripts\post_build.ps1 + - name: Test + run: dotnet test --no-build --verbosity normal -c Release + - name: Upload Plugin Nupkg + uses: actions/upload-artifact@v3 + with: + name: Plugin nupkg + path: | + Output\Release\Flow.Launcher.Plugin.*.nupkg + - name: Upload Setup + uses: actions/upload-artifact@v3 + with: + name: Flow Installer + path: | + Output\Packages\Flow-Launcher-*.exe + # - name: Upload Portable Version + # uses: actions/upload-artifact@v3 + # with: + # name: Portable Version + # path: | + # Output\Packages\Flow-Launcher-Portable.zip + # - name: Upload Full Nupkg + # uses: actions/upload-artifact@v3 + # with: + # name: Full nupkg + # path: | + # Output\Packages\FlowLauncher-*-full.nupkg + + - name: Upload Release Information + uses: actions/upload-artifact@v3 + with: + name: RELEASES + path: | + Output\Packages\RELEASES + + diff --git a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj index 99994255e1a..085a9ab4061 100644 --- a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj +++ b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj @@ -1,4 +1,4 @@ - + net7.0-windows {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3} @@ -43,15 +43,14 @@ - + all - runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj index 71e52ab69f9..580f79404bd 100644 --- a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj +++ b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj @@ -54,13 +54,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Flow.Launcher.Test/Flow.Launcher.Test.csproj b/Flow.Launcher.Test/Flow.Launcher.Test.csproj index 1ae407da440..f9a98c0ab00 100644 --- a/Flow.Launcher.Test/Flow.Launcher.Test.csproj +++ b/Flow.Launcher.Test/Flow.Launcher.Test.csproj @@ -10,21 +10,22 @@ false en + false - + true portable false - bin\Debug\ + bin\Any CPU\Debug\ DEBUG;TRACE prompt 4 false - + pdbonly true - bin\Release\ + bin\Any CPU\Release\ TRACE prompt 4 diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 12d8483c8e3..7f41ec65371 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -1,4 +1,4 @@ - + WinExe net7.0-windows10.0.19041 @@ -10,6 +10,7 @@ false false false + win-x64 en @@ -74,7 +75,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -82,11 +83,10 @@ - + all - runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Flow.Launcher/Properties/PublishProfiles/Net6.0-SelfContained.pubxml b/Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml similarity index 83% rename from Flow.Launcher/Properties/PublishProfiles/Net6.0-SelfContained.pubxml rename to Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml index 23867d894bf..4080880de5a 100644 --- a/Flow.Launcher/Properties/PublishProfiles/Net6.0-SelfContained.pubxml +++ b/Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml @@ -7,12 +7,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release Any CPU - net6.0-windows10.0.19041.0 + net7.0-windows10.0.19041 ..\Output\Release\ win-x64 true False - False + True False diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 43425790402..cd5850e535a 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -2,6 +2,7 @@ Library net7.0-windows + win-x64 true {9B130CC5-14FB-41FF-B310-0A95B6894C37} Properties diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj index 4a285b31fee..92f6750fc62 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj @@ -2,6 +2,7 @@ Library net7.0-windows + win-x64 {59BD9891-3837-438A-958D-ADC7F91F6F7E} Properties Flow.Launcher.Plugin.Caculator diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj index 171c183ef49..f8f7aa77d3d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj @@ -2,6 +2,7 @@ Library net7.0-windows + win-x64 true true true diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj index b426c85b880..3c127b434f5 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj +++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj @@ -3,6 +3,7 @@ Library net7.0-windows {FDED22C8-B637-42E8-824A-63B5B6E05A3A} + win-x64 Properties Flow.Launcher.Plugin.PluginIndicator Flow.Launcher.Plugin.PluginIndicator diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj b/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj index 20a271e4f41..83a8e634f5a 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj @@ -2,6 +2,7 @@ Library net7.0-windows + win-x64 true true true diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj index 30c205efb6a..b90551f4348 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj @@ -4,6 +4,7 @@ net7.0-windows Flow.Launcher.Plugin.ProcessKiller Flow.Launcher.Plugin.ProcessKiller + win-x64 Flow-Launcher https://github.com/Flow-Launcher/Flow.Launcher.Plugin.ProcessKiller https://github.com/Flow-Launcher/Flow.Launcher.Plugin.ProcessKiller @@ -45,8 +46,8 @@ - - + + diff --git a/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj b/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj index 54d2858da2e..b351cbd4bff 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj +++ b/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj @@ -3,6 +3,7 @@ Library net7.0-windows10.0.19041 {FDB3555B-58EF-4AE6-B5F1-904719637AB4} + win-x64 Properties Flow.Launcher.Plugin.Program Flow.Launcher.Plugin.Program diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj b/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj index 649f6732e2e..b583bdb8da6 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj +++ b/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj @@ -3,6 +3,7 @@ Library net7.0-windows {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0} + win-x64 Properties Flow.Launcher.Plugin.Shell Flow.Launcher.Plugin.Shell diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj b/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj index c83c7da4993..9f5c6c97ca5 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj +++ b/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj @@ -7,6 +7,7 @@ Flow.Launcher.Plugin.Sys Flow.Launcher.Plugin.Sys true + win-x64 true true false diff --git a/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj b/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj index 648ffa60e3f..0abe38ad276 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj +++ b/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj @@ -4,6 +4,7 @@ net7.0-windows {A3DCCBCA-ACC1-421D-B16E-210896234C26} true + win-x64 Properties Flow.Launcher.Plugin.Url Flow.Launcher.Plugin.Url diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj b/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj index 2140146c50d..6a6ccb6f524 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj @@ -4,6 +4,7 @@ net7.0-windows {403B57F2-1856-4FC7-8A24-36AB346B763E} Properties + win-x64 true Flow.Launcher.Plugin.WebSearch Flow.Launcher.Plugin.WebSearch diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Flow.Launcher.Plugin.WindowsSettings.csproj b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Flow.Launcher.Plugin.WindowsSettings.csproj index da7a5c6ba71..238586591fd 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Flow.Launcher.Plugin.WindowsSettings.csproj +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Flow.Launcher.Plugin.WindowsSettings.csproj @@ -4,6 +4,7 @@ net7.0-windows true true + win-x64 false Properties prompt diff --git a/Scripts/flowlauncher.nuspec b/Scripts/flowlauncher.nuspec index 8c1b16fe561..f7a416819ef 100644 --- a/Scripts/flowlauncher.nuspec +++ b/Scripts/flowlauncher.nuspec @@ -6,11 +6,11 @@ $version$ Flow-Launcher Team https://github.com/Flow-Launcher/Flow.Launcher - https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher/master/Flow.Launcher/Images/app.png + lib\net7.0\Images\app.png false Flow Launcher - a launcher for windows - + diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index fdf2a034997..3493a9e36af 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -1,14 +1,18 @@ param( - [string]$config = "Release", + [string]$config = "Release", [string]$solution = (Join-Path $PSScriptRoot ".." -Resolve) ) Write-Host "Config: $config" -function Build-Version { - if ([string]::IsNullOrEmpty($env:flowVersion)) { +function Build-Version +{ + if ( [string]::IsNullOrEmpty($env:flowVersion)) + { $targetPath = Join-Path $solution "Output/Release/Flow.Launcher.dll" -Resolve $v = (Get-Command ${targetPath}).FileVersionInfo.FileVersion - } else { + } + else + { $v = $env:flowVersion } @@ -16,12 +20,18 @@ function Build-Version { return $v } -function Build-Path { - if (![string]::IsNullOrEmpty($env:APPVEYOR_BUILD_FOLDER)) { +function Build-Path +{ + if (![string]::IsNullOrEmpty($env:APPVEYOR_BUILD_FOLDER)) + { $p = $env:APPVEYOR_BUILD_FOLDER - } elseif (![string]::IsNullOrEmpty($solution)) { + } + elseif (![string]::IsNullOrEmpty($solution)) + { $p = $solution - } else { + } + else + { $p = Get-Location } @@ -31,23 +41,37 @@ function Build-Path { return $p } -function Copy-Resources ($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 } -function Delete-Unused ($path, $config) { +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 | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } - $deleteList | Remove-Item + $included = @{ } + Get-ChildItem -Path $target -r -Filter "*.dll" | Where-Object { !$_.PsIsContainer -and $_.FullName -notmatch 'Plugins' } | + ForEach-Object { + $included["$( $_.Name )-$( $_.VersionInfo.FileVersion )"] = $true + } + + # $included + + $deleteList = Get-ChildItem "$target\Plugins" -Filter "*.dll" -Recurse | + Where-Object { $included.ContainsKey("$( $_.Name )-$( $_.VersionInfo.FileVersion )") } + + + $deleteList | ForEach-Object { + Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName + Remove-Item $_.FullName } - Remove-Item -Path $target -Include "*.xml" -Recurse + + Remove-Item -Path $target -Include "*.xml" -Recurse } -function Remove-CreateDumpExe ($path, $config) { +function Remove-CreateDumpExe($path, $config) +{ $target = "$path\Output\$config" $depjson = Get-Content $target\Flow.Launcher.deps.json -raw @@ -56,12 +80,14 @@ function Remove-CreateDumpExe ($path, $config) { } -function Validate-Directory ($output) { +function Validate-Directory($output) +{ New-Item $output -ItemType Directory -Force } -function Pack-Squirrel-Installer ($path, $version, $output) { +function Pack-Squirrel-Installer($path, $version, $output) +{ # msbuild based installer generation is not working in appveyor, not sure why Write-Host "Begin pack squirrel installer" @@ -71,7 +97,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) { Write-Host "Packing: $spec" Write-Host "Input path: $input" # making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced. - New-Alias Nuget $env:USERPROFILE\.nuget\packages\NuGet.CommandLine\5.7.2\tools\NuGet.exe -Force + New-Alias Nuget $env:USERPROFILE\.nuget\packages\NuGet.CommandLine\6.3.1\tools\NuGet.exe -Force # 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 @@ -88,7 +114,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" @@ -97,40 +123,43 @@ function Pack-Squirrel-Installer ($path, $version, $output) { Write-Host "End pack squirrel installer" } -function Publish-Self-Contained ($p) { +function Publish-Self-Contained($p) +{ - $csproj = Join-Path "$p" "Flow.Launcher/Flow.Launcher.csproj" -Resolve - $profile = Join-Path "$p" "Flow.Launcher/Properties/PublishProfiles/Net6.0-SelfContained.pubxml" -Resolve + $csproj = Join-Path "$p" "Flow.Launcher/Flow.Launcher.csproj" -Resolve + $profile = Join-Path "$p" "Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml" -Resolve # we call dotnet publish on the main project. # The other projects should have been built in Release at this point. - dotnet publish -c Release $csproj /p:PublishProfile=$profile + dotnet publish --no-build -c Release $csproj /p:PublishProfile=$profile } -function Publish-Portable ($outputLocation, $version) { - +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 } -function Main { +function Main +{ $p = Build-Path $v = Build-Version Copy-Resources $p - if ($config -eq "Release"){ - - Delete-Unused $p $config + if ($config -eq "Release") + { Publish-Self-Contained $p + Delete-Unused $p $config + Remove-CreateDumpExe $p $config $o = "$p\Output\Packages" Validate-Directory $o Pack-Squirrel-Installer $p $v $o - Publish-Portable $o $v } } diff --git a/appveyor.yml b/appveyor.yml index a71779fdc24..b990917ed42 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,6 +7,9 @@ init: - sc config WSearch start= auto # Starts Windows Search service- Needed for running ExplorerTest - net start WSearch +cache: + - packages -> **\packages.config + assembly_info: patch: true file: SolutionAssemblyInfo.cs @@ -28,9 +31,11 @@ before_build: build: project: Flow.Launcher.sln verbosity: minimal -after_build: +after_test: - ps: .\Scripts\post_build.ps1 + + artifacts: - path: 'Output\Release\Flow.Launcher.Plugin.*.nupkg' name: Plugin nupkg