diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000000..ad663a1ffbf --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,110 @@ +# 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: + push: + branches: + - dev + - master + pull_request: + branches: + - dev + - master + +jobs: + build: + + runs-on: windows-latest + env: + FlowVersion: 1.18.0 + 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 }} + - uses: actions/cache@v4 + name: Restore Nuget Cache + with: + path: | + ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget + - uses: actions/cache@v4 + name: Restore dotnet tool Cache + with: + path: | + ~/.dotnet/tools + key: ${{ runner.os }}-dotnet-tools-${{ hashFiles('~/.dotnet/tools/**') }} + restore-keys: | + ${{ runner.os }}-dotnet-tools + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 7.0.x + - 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 -r win-arm64 + - name: Build + run: dotnet build --no-restore -c Release -p:FlowRuntimeIdentifier=win-arm64 + - 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 -p:FlowRuntimeIdentifier=win-arm64 + - 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 + diff --git a/Directory.Build.props b/Directory.Build.props index fa499273c56..bf2e468197c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,6 @@ true + $(FlowRuntimeIdentifier) \ No newline at end of file diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index afc3fbbaa0f..5f92ba46090 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -38,6 +38,13 @@ false + + ARM64;$(DefineConstants) + + + ARM64;$(DefineConstants) + + diff --git a/Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml b/Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml index 0e5cf4489b2..9ce1f958e85 100644 --- a/Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml +++ b/Flow.Launcher/Properties/PublishProfiles/Net7.0-SelfContained.pubxml @@ -6,10 +6,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem Release - Any CPU + ARM64 net7.0-windows10.0.19041.0 ..\Output\Release\ - win-x64 + win-arm64 true False False diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/EverythingSDK/arm64/Everything.dll b/Plugins/Flow.Launcher.Plugin.Explorer/EverythingSDK/arm64/Everything.dll new file mode 100644 index 00000000000..49f487d469b Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/EverythingSDK/arm64/Everything.dll differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index f7d5bdb18e4..87d03a3745d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -127,6 +127,7 @@ Failed to load Everything SDK Warning: Everything service is not running + ARM64 is not supported for everything. Error while querying Everything Sort By Name diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs index e4056131d4b..8a39c8665b8 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs @@ -42,11 +42,13 @@ public Task InitAsync(PluginInitContext context) contextMenu = new ContextMenu(Context, Settings, viewModel); searchManager = new SearchManager(Settings, Context); ResultManager.Init(Context, Settings); - + SortOptionTranslationHelper.API = context.API; +#if !ARM64 EverythingApiDllImport.Load(Path.Combine(Context.CurrentPluginMetadata.PluginDirectory, "EverythingSDK", Environment.Is64BitProcess ? "x64" : "x86")); +#endif return Task.CompletedTask; } @@ -75,7 +77,7 @@ public async Task> QueryAsync(Query query, CancellationToken token) IcoPath = e is EngineNotAvailableException { ErrorIcon: { } iconPath } ? iconPath : Constants.GeneralSearchErrorImagePath, - AsyncAction = e is EngineNotAvailableException {Action: { } action} + AsyncAction = e is EngineNotAvailableException { Action: { } action } ? action : _ => { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs index 6c9155539fe..dac84eba4b1 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs @@ -20,6 +20,15 @@ public EverythingSearchManager(Settings settings) private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken token = default) { +#if ARM64 + throw new EngineNotAvailableException( + Enum.GetName(Settings.IndexSearchEngineOption.Everything)!, + "ARM64 is not supported", + Main.Context.API.GetTranslation("flowlauncher_plugin_everything_not_support_arm64"), + Constants.EverythingErrorImagePath, + _ => ValueTask.FromResult(false)); +#endif + try { if (!await EverythingApi.IsEverythingRunningAsync(token)) @@ -42,7 +51,9 @@ private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken tok private async ValueTask ClickToInstallEverythingAsync(ActionContext _) { - var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API); + var installedPath = + await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, + Main.Context.API); if (installedPath == null) { @@ -57,17 +68,18 @@ private async ValueTask ClickToInstallEverythingAsync(ActionContext _) return true; } - public async IAsyncEnumerable SearchAsync(string search, [EnumeratorCancellation] CancellationToken token) + public async IAsyncEnumerable SearchAsync(string search, + [EnumeratorCancellation] CancellationToken token) { await ThrowIfEverythingNotAvailableAsync(token); if (token.IsCancellationRequested) yield break; - var option = new EverythingSearchOption(search, - Settings.SortOption, - MaxCount: Settings.MaxResult, - IsFullPathSearch: Settings.EverythingSearchFullPath, + var option = new EverythingSearchOption(search, + Settings.SortOption, + MaxCount: Settings.MaxResult, + IsFullPathSearch: Settings.EverythingSearchFullPath, IsRunCounterEnabled: Settings.EverythingEnableRunCount); await foreach (var result in EverythingApi.SearchAsync(option, token)) @@ -110,7 +122,8 @@ public async IAsyncEnumerable ContentSearchAsync(string plainSearc } } - public async IAsyncEnumerable EnumerateAsync(string path, string search, bool recursive, [EnumeratorCancellation] CancellationToken token) + public async IAsyncEnumerable EnumerateAsync(string path, string search, bool recursive, + [EnumeratorCancellation] CancellationToken token) { await ThrowIfEverythingNotAvailableAsync(token); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 8fd1674765f..c6daafdd7b6 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -99,7 +99,7 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKey case false when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword) || ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword): - + searchResults = Settings.IndexProvider.SearchAsync(query.Search, token); engineName = Enum.GetName(Settings.IndexSearchEngine); break; diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 1757ed99e22..63dab0ed8e3 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -130,7 +130,7 @@ function Main { Validate-Directory $o Pack-Squirrel-Installer $p $v $o - Publish-Portable $o $v +# Publish-Portable $o $v } } diff --git a/appveyor.yml b/appveyor.yml index 42108813354..a3de18c8019 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,13 +23,14 @@ assembly_info: assembly_informational_version: $(flowVersion) image: Visual Studio 2022 -platform: Any CPU +platform: ARM64 configuration: Release before_build: - ps: nuget restore build: project: Flow.Launcher.sln verbosity: minimal + test_script: - dotnet test --no-build -c Release after_test: