Skip to content

Commit 7d5e092

Browse files
committed
Merge branch 'main' of https://github.com/files-community/Files into terminal
2 parents 3128532 + f3a72e1 commit 7d5e092

File tree

133 files changed

+1902
-1271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+1902
-1271
lines changed
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: Deploy Preview Pipeline
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: windows-latest
9+
environment: Deployments
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
configuration: [Preview]
14+
platform: [x64]
15+
env:
16+
SOLUTION_NAME: 'Files.sln'
17+
PACKAGE_PROJECT_DIR: 'src\Files.App (Package)'
18+
PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj'
19+
TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj'
20+
CONFIGURATION: ${{ matrix.configuration }}
21+
PLATFORM: ${{ matrix.platform }}
22+
APPX_BUNDLE_PLATFORMS: 'x64|arm64'
23+
WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\
24+
ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts
25+
APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages
26+
27+
steps:
28+
- name: Checkout the repository
29+
uses: actions/checkout@v3
30+
31+
- name: Setup MSBuild
32+
uses: microsoft/setup-msbuild@v1
33+
34+
- name: Setup NuGet
35+
uses: NuGet/setup-nuget@v1.1.1
36+
37+
- name: Setup .NET 7
38+
uses: actions/setup-dotnet@v3
39+
with:
40+
dotnet-version: '7.0.x'
41+
42+
# TODO: Move the command to PowerShell script instead
43+
- name: Update Package.appxmanifest
44+
shell: pwsh
45+
run: |
46+
[xml]$xmlDoc = Get-Content "$env:PACKAGE_PROJECT_DIR\Package.appxmanifest"
47+
$xmlDoc.Package.Identity.Name="FilesPreview"
48+
$xmlDoc.Package.Identity.Publisher="$env:SIDELOAD_PUBLISHER_SECRET"
49+
$xmlDoc.Package.Properties.DisplayName="Files - Preview"
50+
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview"
51+
$xmlDoc.Save("$env:PACKAGE_PROJECT_DIR\Package.appxmanifest")
52+
env:
53+
SIDELOAD_PUBLISHER_SECRET: ${{ secrets.SIDELOAD_PUBLISHER_SECRET }}
54+
55+
# TODO: Move the command to PowerShell script instead
56+
- name: Use the ${{ env.CONFIGURATION }} logo sets
57+
shell: pwsh
58+
run: |
59+
Get-ChildItem "$env:WORKING_DIR\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process `
60+
{ `
61+
(Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | `
62+
Set-Content $_ -NoNewline `
63+
}
64+
65+
- name: Inject the Bing Maps API token
66+
shell: pwsh
67+
run: |
68+
Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process `
69+
{ `
70+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "bingmapskey.secret", "$env:BING_MAPS_SECRET" }) | `
71+
Set-Content $_ -NoNewline `
72+
}
73+
env:
74+
BING_MAPS_SECRET: ${{ secrets.BING_MAPS_SECRET }}
75+
76+
- name: Inject the AppCenter token
77+
shell: pwsh
78+
run: |
79+
Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process `
80+
{ `
81+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "appcenter.secret", "$env:APP_CENTER_SECRET" }) | `
82+
Set-Content $_ -NoNewline `
83+
}
84+
env:
85+
APP_CENTER_SECRET: ${{ secrets.APP_CENTER_SECRET }}
86+
87+
- name: Inject the GitHub OAuth client ID
88+
run: |
89+
Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process `
90+
{ `
91+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "githubclientid.secret", "$env:GH_OAUTH_CLIENT_ID" }) | `
92+
Set-Content $_ -NoNewline `
93+
}
94+
env:
95+
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
96+
97+
- name: Use Windows SDK Preview
98+
shell: cmd
99+
run: |
100+
for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt
101+
102+
- name: Restore NuGet
103+
shell: pwsh
104+
run: 'nuget restore $env:SOLUTION_NAME'
105+
106+
- name: Restore ${{ env.SOLUTION_NAME }}
107+
shell: pwsh
108+
run: |
109+
msbuild $env:SOLUTION_NAME `
110+
-t:Restore `
111+
-p:Platform=$env:PLATFORM `
112+
-p:Configuration=$env:CONFIGURATION `
113+
-p:PublishReadyToRun=true
114+
115+
- name: Build ${{ env.SOLUTION_NAME }}
116+
shell: pwsh
117+
run: |
118+
msbuild "$env:PACKAGE_PROJECT_PATH" `
119+
-t:Build `
120+
-t:_GenerateAppxPackage `
121+
-p:Platform=$env:PLATFORM `
122+
-p:Configuration=$env:CONFIGURATION `
123+
-p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS `
124+
-p:AppxPackageDir="$env:APPX_PACKAGE_DIR" `
125+
-p:AppxBundle=Always `
126+
-p:UapAppxPackageBuildMode=Sideload `
127+
-p:GenerateAppInstallerFile=True `
128+
-p:AppInstallerUri=https://cdn.files.community/files/preview/
129+
130+
- name: Remove empty files from the packages
131+
shell: bash
132+
run: find $ARTIFACTS_STAGING_DIR -empty -delete
133+
134+
- name: Sign files with Azure Code Signing
135+
uses: azure/azure-code-signing-action@v0.2.21
136+
with:
137+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
138+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
139+
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
140+
endpoint: https://wus2.codesigning.azure.net/
141+
code-signing-account-name: ${{ secrets.SIGNING_ACCOUNT_NAME }}
142+
certificate-profile-name: ${{ secrets.SIGNING_PROFILE_NAME }}
143+
files-folder: ${{ env.APPX_PACKAGE_DIR }}
144+
files-folder-filter: msixbundle
145+
files-folder-recurse: true
146+
files-folder-depth: 4
147+
file-digest: SHA256
148+
timestamp-rfc3161: http://timestamp.acs.microsoft.com
149+
timestamp-digest: SHA256
150+
151+
- uses: azure/login@v1
152+
with:
153+
creds: ${{ secrets.AZURE_CREDENTIALS }}
154+
155+
- name: Upload to blob storage
156+
uses: azure/powershell@v1
157+
with:
158+
inlineScript: |
159+
az storage blob upload-batch --account-name "filescommunity" --destination "files" --destination-path "test" --source ${{ env.APPX_PACKAGE_DIR }} --overwrite true
160+
azPSVersion: "latest"
161+
162+
# Azure logout
163+
- name: logout
164+
run: |
165+
az logout
166+
167+
- name: Upload the packages to GitHub Actions
168+
uses: actions/upload-artifact@v3
169+
with:
170+
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})'
171+
path: ${{ env.ARTIFACTS_STAGING_DIR }}

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
[![Build Status](https://dev.azure.com/filescommunity/Files/_apis/build/status/Build%20Pipeline?branchName=main)](https://dev.azure.com/filescommunity/Files/_build/latest?definitionId=4&branchName=main)
77
[![Crowdin](https://badges.crowdin.net/files-app/localized.svg)](https://crowdin.com/project/files-app)
88
[![Discord](https://discordapp.com/api/guilds/725513575971684472/widget.png)](https://discord.gg/files)
9-
<a style="text-decoration:none" href="https://files.community/download">
10-
<img src="https://img.shields.io/badge/Download%20Installer-blue.svg?style=flat-round" alt="Download link" />
11-
</a>
12-
<a style="text-decoration:none" href="https://files.community/docs">
13-
<img src="https://img.shields.io/badge/View%20Documentation-purple.svg?style=flat-round" alt="Documentation link" />
14-
</a>
9+
[![Download](https://img.shields.io/badge/Download%20Installer-blue.svg?style=flat-round)](https://files.community/download)
10+
[![Documentation](https://img.shields.io/badge/View%20Documentation-purple.svg?style=flat-round)](https://files.community/download")
1511

1612
Introducing Files, the ultimate file manager app for Windows. With its sleek and intuitive design, navigating through your files has never been easier. Files features tabs for easy switching between different folders, a column view for quick file browsing, and dual pane support for efficient file management. In addition, you can easily create and extract archives with just a few clicks, making file compression and decompression a breeze.
1713

src/Files.App (Package)/Files.Package.wapproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,29 @@
8585
<Platform>x86</Platform>
8686
</ProjectConfiguration>
8787
</ItemGroup>
88+
8889
<PropertyGroup>
8990
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
9091
<PathToXAMLWinRTImplementations>Files.App\</PathToXAMLWinRTImplementations>
9192
</PropertyGroup>
93+
9294
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
95+
9396
<ItemGroup>
9497
<AppxManifest Include="Package.appxmanifest">
9598
<SubType>Designer</SubType>
9699
</AppxManifest>
97100
<Content Include="Assets\AppTiles\Dev\**" />
98101
<Content Include="Package.appinstaller" />
99102
</ItemGroup>
103+
100104
<ItemGroup>
101105
<ProjectReference Include="..\Files.App\Files.App.csproj">
102106
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
103107
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
104108
</ProjectReference>
105109
</ItemGroup>
110+
106111
<ItemGroup>
107112
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" IncludeAssets="build" />
108113
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" IncludeAssets="build" />

src/Files.App (Package)/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Identity
1717
Name="FilesDev"
1818
Publisher="CN=Files"
19-
Version="2.5.31.0" />
19+
Version="3.0.0.0" />
2020

2121
<Properties>
2222
<DisplayName>Files - Dev</DisplayName>

src/Files.App/App.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ private void EnsureSuperEarlyWindow()
264264

265265
// Hook events for the window
266266
window.Activated += Window_Activated;
267-
window.Closed += Window_ClosedAsync;
267+
window.Closed += Window_Closed;
268268

269269
// Attempt to activate it
270270
window.Activate();
@@ -294,7 +294,7 @@ public void OnActivated(AppActivationArguments activatedEventArgs)
294294
/// </summary>
295295
/// <param name="sender">The source of the suspend request.</param>
296296
/// <param name="args">Details about the suspend request.</param>
297-
private async void Window_ClosedAsync(object sender, WindowEventArgs args)
297+
private async void Window_Closed(object sender, WindowEventArgs args)
298298
{
299299
// Save application state and stop any background activity
300300

src/Files.App/Data/Contexts/Multitasking/MultitaskingContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ internal class MultitaskingContext : ObservableObject, IMultitaskingContext
1717
private ushort tabCount = 0;
1818
public ushort TabCount => tabCount;
1919

20-
public TabBarItem CurrentTabItem => MainPageViewModel.AppInstances[currentTabIndex];
21-
public TabBarItem SelectedTabItem => MainPageViewModel.AppInstances[selectedTabIndex];
20+
public TabBarItem CurrentTabItem => MainPageViewModel.AppInstances.ElementAtOrDefault(currentTabIndex);
21+
public TabBarItem SelectedTabItem => MainPageViewModel.AppInstances.ElementAtOrDefault(selectedTabIndex);
2222

2323
private ushort currentTabIndex = 0;
2424
public ushort CurrentTabIndex => currentTabIndex;

src/Files.App/Data/Items/DriveItem.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ public FrameworkElement? ItemDecorator
204204
{
205205
if (!IsRemovable)
206206
return null; // Removable items don't need the eject button
207+
207208
var itemDecorator = new Button()
208209
{
209210
Style = Application.Current.Resources["SidebarEjectButtonStyle"] as Style,
@@ -214,12 +215,16 @@ public FrameworkElement? ItemDecorator
214215
Width = 16
215216
}
216217
};
217-
itemDecorator.Click += ItemDecorator_ClickAsync;
218+
219+
ToolTipService.SetToolTip(itemDecorator, "Eject".GetLocalizedResource());
220+
221+
itemDecorator.Click += ItemDecorator_Click;
222+
218223
return itemDecorator;
219224
}
220225
}
221226

222-
private async void ItemDecorator_ClickAsync(object sender, RoutedEventArgs e)
227+
private async void ItemDecorator_Click(object sender, RoutedEventArgs e)
223228
{
224229
var result = await DriveHelpers.EjectDeviceAsync(Path);
225230
await UIHelpers.ShowDeviceEjectResultAsync(Type, result);

src/Files.App/Data/Items/FileTagItem.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Licensed under the MIT License. See the LICENSE.
33

44
using CommunityToolkit.WinUI.Helpers;
5-
using Files.App.Converters;
6-
using Files.Core.ViewModels.FileTags;
75
using Microsoft.UI.Xaml;
86
using Microsoft.UI.Xaml.Controls;
97
using Microsoft.UI.Xaml.Markup;

src/Files.App/Data/Models/DrivesViewModel.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ public DrivesViewModel(IRemovableDrivesService removableDrivesService, ISizeProv
4040
watcher = removableDrivesService.CreateWatcher();
4141
watcher.DeviceAdded += Watcher_DeviceAdded;
4242
watcher.DeviceRemoved += Watcher_DeviceRemoved;
43-
watcher.DeviceModified += Watcher_DeviceModifiedAsync;
44-
watcher.EnumerationCompleted += Watcher_EnumerationCompletedAsync;
43+
watcher.DeviceModified += Watcher_DeviceModified;
44+
watcher.EnumerationCompleted += Watcher_EnumerationCompleted;
4545
}
4646

47-
private async void Watcher_EnumerationCompletedAsync(object? sender, System.EventArgs e)
47+
private async void Watcher_EnumerationCompleted(object? sender, System.EventArgs e)
4848
{
4949
logger.LogDebug("Watcher_EnumerationCompleted");
5050
await folderSizeProvider.CleanAsync();
5151
}
5252

53-
private async void Watcher_DeviceModifiedAsync(object? sender, string e)
53+
private async void Watcher_DeviceModified(object? sender, string e)
5454
{
5555
var matchingDriveEjected = Drives.FirstOrDefault(x => Path.GetFullPath(x.Path) == Path.GetFullPath(e));
5656
if (matchingDriveEjected != null)
@@ -68,7 +68,7 @@ private void Watcher_DeviceRemoved(object? sender, string e)
6868
}
6969

7070
// Update the collection on the ui-thread.
71-
Watcher_EnumerationCompletedAsync(null, EventArgs.Empty);
71+
Watcher_EnumerationCompleted(null, EventArgs.Empty);
7272
}
7373

7474
private void Watcher_DeviceAdded(object? sender, ILocatableFolder e)
@@ -90,7 +90,7 @@ private void Watcher_DeviceAdded(object? sender, ILocatableFolder e)
9090
Drives.Add(e);
9191
}
9292

93-
Watcher_EnumerationCompletedAsync(null, EventArgs.Empty);
93+
Watcher_EnumerationCompleted(null, EventArgs.Empty);
9494
}
9595

9696
public async Task UpdateDrivesAsync()
@@ -116,8 +116,8 @@ public void Dispose()
116116
watcher.Stop();
117117
watcher.DeviceAdded -= Watcher_DeviceAdded;
118118
watcher.DeviceRemoved -= Watcher_DeviceRemoved;
119-
watcher.DeviceModified -= Watcher_DeviceModifiedAsync;
120-
watcher.EnumerationCompleted -= Watcher_EnumerationCompletedAsync;
119+
watcher.DeviceModified -= Watcher_DeviceModified;
120+
watcher.EnumerationCompleted -= Watcher_EnumerationCompleted;
121121
}
122122
}
123123
}

0 commit comments

Comments
 (0)