Skip to content

Commit 589ca67

Browse files
authored
Merge branch 'files-community:main' into editorconfig
2 parents 29efe17 + 45aa133 commit 589ca67

File tree

237 files changed

+7480
-1954
lines changed

Some content is hidden

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

237 files changed

+7480
-1954
lines changed

.github/PRIVACY.md

+1-29
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,3 @@
11
# Privacy Policy
22

3-
###### Effective date: June 2, 2024
4-
5-
This Privacy Policy ("Policy") for Files ("we", "us", or "our") describes how and why we collect, store, use, and disclose information about users ("you", "your") when you use our services ("Services"), and our desktop application (the "Application", "Files"). By using our Services, you acknowledge and consent to the practices described in this Policy.
6-
7-
## Table of Contents
8-
9-
1. Information We Collect
10-
2. How We Use Your Information
11-
3. Changes to This Privacy Policy
12-
13-
## Information We Collect
14-
15-
**Diagnostic Information.** Our Application collects non-personably identifiable diagnostic data such as fault analysis and performance logs. This information may include technical details about your device, such as its make, model, operating system, and Application version. In addition, Files may store log files containing diagnostic information on the user's device. These files are not shared with us by default.
16-
17-
**Usage Information.** We collect non-identifiable information about your use of our Services, including but not limited to interactions within the Application, enabled user preferences (Application settings), and usage patterns. Our Application uses Sentry for error reporting, please review the Sentry Privacy Policy here: https://sentry.io/privacy/.
18-
19-
Furthermore, we use certain Microsoft services such as Microsoft Partner Center to collect usage data, to learn more about how data is collected, used, and disclosed by Microsoft and its subsidiaries, please review the Microsoft Privacy Policy Statement available here: https://privacy.microsoft.com/privacystatement
20-
21-
Please note that any information we collect is non-identifiable and does not include any personal data. We do not share collected information with any third parties.
22-
23-
## How We Use Collected Information
24-
25-
**Mitigate Reliability Issues.** We may use the aggregated information to diagnose and address any unexpected issues that may arise during the use of our Application. This may include analyzing diagnostic data, such as fault analysis and performance logs, to identify the root cause of the issue and develop a solution to resolve it.
26-
27-
**Identify Usage Trends.** We may use the information to identify and analyze usage trends for our Services and Application. This may include analyzing aggregated usage data to understand how users interact with our Services and to measure their utilization intensity. We may use this analysis to improve the functionality, usability, and performance of our Services and to inform future development decisions.
28-
29-
## Changes to This Privacy Policy
30-
31-
We may modify, update, or amend this Privacy Policy from time to time to reflect changes made to our Application. When we change this Policy in a material manner, we will inform you of such changes by updating the 'Effective date' notice. It is your responsibility to review this Privacy Policy periodically to stay informed of any updates. Your continued use of the Services after any modifications to this Policy constitutes your acceptance of such changes.
3+
The privacy policy has been moved to here https://files.community/privacy

.github/scripts/Configure-AppxManifest.ps1

+87-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the MIT License. See the LICENSE.
33

44
param(
5-
[string]$Branch = "",
5+
[string]$Branch = "", # This has to correspond with one of the AppEnvironment enum values
66
[string]$PackageManifestPath = "",
77
[string]$Publisher = "",
88
[string]$WorkingDir = "",
@@ -11,16 +11,68 @@ param(
1111
[string]$SecretGitHubOAuthClientId = ""
1212
)
1313

14+
# Load Package.appxmanifest
1415
[xml]$xmlDoc = Get-Content $PackageManifestPath
16+
17+
# Add namespaces
18+
$nsmgr = New-Object System.Xml.XmlNamespaceManager($xmlDoc.NameTable)
19+
$nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundation/windows10")
20+
$nsmgr.AddNamespace("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities")
21+
$nsmgr.AddNamespace("uap", "http://schemas.microsoft.com/appx/manifest/uap/windows10")
22+
$nsmgr.AddNamespace("uap5", "http://schemas.microsoft.com/appx/manifest/uap/windows10/5")
23+
$ap = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']/uap:Protocol", $nsmgr)
24+
$aea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias", $nsmgr)
25+
$ea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap5:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias/uap5:ExecutionAlias", $nsmgr)
26+
27+
# Update the publisher
1528
$xmlDoc.Package.Identity.Publisher = $Publisher
1629

17-
if ($Branch -eq "Preview")
30+
if ($Branch -eq "SideloadPreview")
1831
{
1932
# Set identities
2033
$xmlDoc.Package.Identity.Name="FilesPreview"
2134
$xmlDoc.Package.Properties.DisplayName="Files - Preview"
2235
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview"
2336
$xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files - Preview"
37+
38+
# Update app protocol and execution alias
39+
$ap.SetAttribute("Name", "files-preview");
40+
$ea.SetAttribute("Alias", "files-preview.exe");
41+
42+
# Save modified Package.appxmanifest
43+
$xmlDoc.Save($PackageManifestPath)
44+
45+
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process `
46+
{ `
47+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | `
48+
Set-Content $_ -NoNewline `
49+
}
50+
51+
Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process `
52+
{ `
53+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files-preview" }) | `
54+
Set-Content $_ -NoNewline `
55+
}
56+
}
57+
elseif ($Branch -eq "StorePreview")
58+
{
59+
# Set identities
60+
$xmlDoc.Package.Identity.Name="49306atecsolution.FilesPreview"
61+
$xmlDoc.Package.Properties.DisplayName="Files - Preview"
62+
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview"
63+
$xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="49306atecsolution.FilesPreview"
64+
65+
# Remove capability that is only used for the sideload package
66+
$nsmgr = New-Object System.Xml.XmlNamespaceManager($xmlDoc.NameTable)
67+
$nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundation/windows10")
68+
$nsmgr.AddNamespace("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities")
69+
$pm = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Capabilities/rescap:Capability[@Name='packageManagement']", $nsmgr)
70+
$xmlDoc.Package.Capabilities.RemoveChild($pm)
71+
72+
# Update app protocol and execution alias
73+
$ap.SetAttribute("Name", "files-preview");
74+
$ea.SetAttribute("Alias", "files-preview.exe");
75+
2476
$xmlDoc.Save($PackageManifestPath)
2577

2678
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process `
@@ -29,42 +81,69 @@ if ($Branch -eq "Preview")
2981
Set-Content $_ -NoNewline `
3082
}
3183
}
32-
elseif ($Branch -eq "Stable")
84+
elseif ($Branch -eq "SideloadStable")
3385
{
3486
# Set identities
3587
$xmlDoc.Package.Identity.Name="Files"
3688
$xmlDoc.Package.Properties.DisplayName="Files"
3789
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files"
3890
$xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files"
91+
92+
# Update app protocol and execution alias
93+
$ap.SetAttribute("Name", "files-stable");
94+
$ea.SetAttribute("Alias", "files-stable.exe");
95+
96+
# Save modified Package.appxmanifest
3997
$xmlDoc.Save($PackageManifestPath)
4098

4199
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process `
42100
{ `
43101
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | `
44102
Set-Content $_ -NoNewline `
45103
}
104+
105+
Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process `
106+
{ `
107+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files-stable" }) | `
108+
Set-Content $_ -NoNewline `
109+
}
46110
}
47-
elseif ($Branch -eq "Store")
111+
elseif ($Branch -eq "StoreStable")
48112
{
49113
# Set identities
50114
$xmlDoc.Package.Identity.Name="49306atecsolution.FilesUWP"
51115
$xmlDoc.Package.Properties.DisplayName="Files App"
52116
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files"
53117
$xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName="Files"
54118

55-
# Remove an capability that is used for the sideload
56-
$nsmgr = New-Object System.Xml.XmlNamespaceManager($xmlDoc.NameTable)
57-
$nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundation/windows10")
58-
$nsmgr.AddNamespace("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities")
119+
# Remove capability that is only used for the sideload package
59120
$pm = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Capabilities/rescap:Capability[@Name='packageManagement']", $nsmgr)
60121
$xmlDoc.Package.Capabilities.RemoveChild($pm)
122+
123+
# Update app protocol and execution alias
124+
$ap.SetAttribute("Name", "files");
125+
$aea.RemoveChild($aea.FirstChild); # Avoid duplication
126+
127+
# Save modified Package.appxmanifest
61128
$xmlDoc.Save($PackageManifestPath)
62129

63130
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process `
64131
{ `
65132
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | `
66133
Set-Content $_ -NoNewline `
67134
}
135+
136+
Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process `
137+
{ `
138+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files" }) | `
139+
Set-Content $_ -NoNewline `
140+
}
141+
}
142+
143+
Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process `
144+
{ `
145+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "cd_app_env_placeholder", $Branch }) | `
146+
Set-Content $_ -NoNewline `
68147
}
69148

70149
Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process `

.github/workflows/cd-preview.yml renamed to .github/workflows/cd-sideload-preview.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# 4. Sign the package
1212
# 5. Publish the package to Azure
1313

14-
name: Files CD (Preview)
14+
name: Files CD (Sideload Preview)
1515

1616
on:
1717
workflow_dispatch:
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
configuration: [Preview]
26+
configuration: [Release]
2727
platform: [x64]
2828
env:
2929
SOLUTION_NAME: 'Files.sln'
@@ -55,7 +55,7 @@ jobs:
5555
shell: pwsh
5656
run: |
5757
. './.github/scripts/Configure-AppxManifest.ps1' `
58-
-Branch "$env:CONFIGURATION" `
58+
-Branch "SideloadPreview" `
5959
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
6060
-Publisher "$env:SIDELOAD_PUBLISHER_SECRET" `
6161
-WorkingDir "$env:WORKING_DIR" `

.github/workflows/cd-stable.yml renamed to .github/workflows/cd-sideload-stable.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# 4. Sign the package
1212
# 5. Publish the package to Azure
1313

14-
name: Files CD (Stable)
14+
name: Files CD (Sideload Stable)
1515

1616
on:
1717
workflow_dispatch:
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
configuration: [Stable]
26+
configuration: [Release]
2727
platform: [x64]
2828
env:
2929
SOLUTION_NAME: 'Files.sln'
@@ -55,7 +55,7 @@ jobs:
5555
shell: pwsh
5656
run: |
5757
. './.github/scripts/Configure-AppxManifest.ps1' `
58-
-Branch "$env:CONFIGURATION" `
58+
-Branch "SideloadStable" `
5959
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
6060
-Publisher "$env:SIDELOAD_PUBLISHER_SECRET" `
6161
-WorkingDir "$env:WORKING_DIR" `
+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Copyright (c) 2024 Files Community
2+
# Licensed under the MIT License. See the LICENSE.
3+
4+
# Abstract:
5+
# Deploys Files Preview (Store).
6+
#
7+
# Workflow:
8+
# 1. Configure manifest, logo and secrets
9+
# 2. Restore, build and package Files
10+
# 3. Generate a msixupload file
11+
# 4. Publish the msixupload to GitHub Actions
12+
13+
name: Files CD (Store Preview)
14+
15+
on:
16+
workflow_dispatch:
17+
18+
jobs:
19+
build:
20+
runs-on: windows-latest
21+
environment: Deployments
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
configuration: [Release]
26+
platform: [x64]
27+
env:
28+
SOLUTION_NAME: 'Files.sln'
29+
CONFIGURATION: '${{ matrix.configuration }}'
30+
PLATFORM: '${{ matrix.platform }}'
31+
APPX_BUNDLE_PLATFORMS: 'x64|arm64'
32+
WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\
33+
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'
34+
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages'
35+
PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\Files.App (Package)'
36+
PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App (Package)\Files.Package.wapproj'
37+
PACKAGE_MANIFEST_PATH: '${{ github.workspace }}\src\Files.App (Package)\Package.appxmanifest'
38+
39+
steps:
40+
- name: Checkout the repository
41+
uses: actions/checkout@v4
42+
- name: Setup MSBuild
43+
uses: microsoft/setup-msbuild@v2
44+
- name: Setup NuGet
45+
uses: NuGet/setup-nuget@v2
46+
- name: Setup .NET 8
47+
uses: actions/setup-dotnet@v4
48+
with:
49+
global-json-file: global.json
50+
51+
- name: Configure the package manifest, logo, and secrets
52+
shell: pwsh
53+
run: |
54+
. './.github/scripts/Configure-AppxManifest.ps1' `
55+
-Branch "StorePreview" `
56+
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
57+
-Publisher "$env:STORE_PUBLISHER_SECRET" `
58+
-WorkingDir "$env:WORKING_DIR" `
59+
-SecretBingMapsKey "$env:SECRET_BINGMAPS_KEY" `
60+
-SecretSentry "$env:SECRET_SENTRY" `
61+
-SecretGitHubOAuthClientId "$env:SECRET_GITHUB_OAUTH_CLIENT_ID"
62+
env:
63+
STORE_PUBLISHER_SECRET: ${{ secrets.STORE_PUBLISHER_SECRET }}
64+
SECRET_BINGMAPS_KEY: ${{ secrets.BING_MAPS_SECRET }}
65+
SECRET_SENTRY: ${{ secrets.SENTRY_SECRET }}
66+
SECRET_GITHUB_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
67+
68+
- name: Use Windows SDK Preview
69+
shell: cmd
70+
run: |
71+
for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt
72+
73+
- name: Restore NuGet
74+
shell: pwsh
75+
run: 'nuget restore $env:SOLUTION_NAME'
76+
77+
- name: Restore Files
78+
shell: pwsh
79+
run: |
80+
msbuild $env:SOLUTION_NAME `
81+
-t:Restore `
82+
-p:Platform=$env:PLATFORM `
83+
-p:Configuration=$env:CONFIGURATION `
84+
-p:PublishReadyToRun=true
85+
86+
- name: Build & package Files
87+
shell: pwsh
88+
run: |
89+
msbuild "$env:PACKAGE_PROJECT_PATH" `
90+
-t:Build `
91+
-t:_GenerateAppxPackage `
92+
-p:Platform=$env:PLATFORM `
93+
-p:Configuration=$env:CONFIGURATION `
94+
-p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS `
95+
-p:AppxPackageDir="$env:APPX_PACKAGE_DIR" `
96+
-p:AppxBundle=Always `
97+
-p:UapAppxPackageBuildMode=StoreUpload
98+
99+
- name: Remove empty files from the packages
100+
shell: bash
101+
run: find $ARTIFACTS_STAGING_DIR -empty -delete
102+
103+
- name: Upload the packages to GitHub Actions
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})'
107+
path: ${{ env.ARTIFACTS_STAGING_DIR }}

.github/workflows/cd-store.yml renamed to .github/workflows/cd-store-stable.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# 3. Generate a msixupload file
1111
# 4. Publish the msixupload to GitHub Actions
1212

13-
name: Files CD (Store)
13+
name: Files CD (Store Stable)
1414

1515
on:
1616
workflow_dispatch:
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
configuration: [Store]
25+
configuration: [Release]
2626
platform: [x64]
2727
env:
2828
SOLUTION_NAME: 'Files.sln'
@@ -52,7 +52,7 @@ jobs:
5252
shell: pwsh
5353
run: |
5454
. './.github/scripts/Configure-AppxManifest.ps1' `
55-
-Branch "$env:CONFIGURATION" `
55+
-Branch "StoreStable" `
5656
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
5757
-Publisher "$env:STORE_PUBLISHER_SECRET" `
5858
-WorkingDir "$env:WORKING_DIR" `

.github/workflows/ci.yml

+5
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ jobs:
243243
$env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll `
244244
--logger "trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx"
245245
246+
- if: github.event_name == 'pull_request'
247+
uses: geekyeggo/delete-artifact@v5
248+
with:
249+
name: '*'
250+
246251
# - name: Generate markdown from the tests result
247252
# shell: pwsh
248253
# run: |

0 commit comments

Comments
 (0)