Skip to content

Commit 258e1ba

Browse files
committed
Revert
1 parent 04b23d2 commit 258e1ba

File tree

6 files changed

+556
-202
lines changed

6 files changed

+556
-202
lines changed

.github/scripts/Configure-AppxManifest.ps1

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

44
param(
5-
[string]$ReleaseBranch = "", # SideloadPreview, SideloadStable, StorePreview, or StoreStable
5+
[string]$Branch = "", # SideloadPreview, SideloadStable, StorePreview, or StoreStable
66
[string]$PackageManifestPath = "",
77
[string]$Publisher = "",
88
[string]$WorkingDir = "",
@@ -27,7 +27,7 @@ $ea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pk
2727
# Update the publisher
2828
$xmlDoc.Package.Identity.Publisher = $Publisher
2929

30-
if ($ReleaseBranch -eq "SideloadPreview")
30+
if ($Branch -eq "SideloadPreview")
3131
{
3232
# Set identities
3333
$xmlDoc.Package.Identity.Name="FilesPreview"
@@ -54,7 +54,7 @@ if ($ReleaseBranch -eq "SideloadPreview")
5454
Set-Content $_ -NoNewline `
5555
}
5656
}
57-
elseif ($ReleaseBranch -eq "StorePreview")
57+
elseif ($Branch -eq "StorePreview")
5858
{
5959
# Set identities
6060
$xmlDoc.Package.Identity.Name="49306atecsolution.FilesPreview"
@@ -87,7 +87,7 @@ elseif ($ReleaseBranch -eq "StorePreview")
8787
Set-Content $_ -NoNewline `
8888
}
8989
}
90-
elseif ($ReleaseBranch -eq "SideloadStable")
90+
elseif ($Branch -eq "SideloadStable")
9191
{
9292
# Set identities
9393
$xmlDoc.Package.Identity.Name="Files"
@@ -114,7 +114,7 @@ elseif ($ReleaseBranch -eq "SideloadStable")
114114
Set-Content $_ -NoNewline `
115115
}
116116
}
117-
elseif ($ReleaseBranch -eq "StoreStable")
117+
elseif ($Branch -eq "StoreStable")
118118
{
119119
# Set identities
120120
$xmlDoc.Package.Identity.Name="49306atecsolution.FilesUWP"
@@ -148,7 +148,7 @@ elseif ($ReleaseBranch -eq "StoreStable")
148148

149149
Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process `
150150
{ `
151-
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "cd_app_env_placeholder", $ReleaseBranch }) | `
151+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "cd_app_env_placeholder", $Branch }) | `
152152
Set-Content $_ -NoNewline `
153153
}
154154

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Copyright (c) Files Community
2+
# Licensed under the MIT License.
3+
4+
# Abstract:
5+
# Deploys Files Preview (Sideload).
6+
#
7+
# Workflow:
8+
# 1. Configure manifest, logo and secrets
9+
# 2. Restore, build and package Files
10+
# 3. Publish the appinstaller to files.community
11+
# 4. Sign the package
12+
# 5. Publish the package to Azure
13+
14+
name: Files CD (Sideload Preview)
15+
16+
on:
17+
workflow_dispatch:
18+
19+
jobs:
20+
build:
21+
runs-on: windows-latest
22+
environment: Deployments
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
configuration: [Release]
27+
platform: [x64]
28+
env:
29+
SOLUTION_NAME: 'Files.slnx'
30+
CONFIGURATION: '${{ matrix.configuration }}'
31+
PLATFORM: '${{ matrix.platform }}'
32+
APPX_BUNDLE_PLATFORMS: 'x64|arm64'
33+
WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\
34+
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'
35+
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages'
36+
PACKAGE_PROJECT_DIR: 'src\Files.App (Package)'
37+
PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj'
38+
PACKAGE_MANIFEST_PATH: 'src\Files.App (Package)\Package.appxmanifest'
39+
LAUNCHER_PROJECT_PATH: 'src\Files.App.Launcher\Files.App.Launcher.vcxproj'
40+
TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj'
41+
APP_INSTALLER_SIDELOAD_URL: 'https://cdn.files.community/files/preview/'
42+
43+
steps:
44+
- name: Checkout the repository
45+
uses: actions/checkout@v4
46+
- name: Setup MSBuild
47+
uses: microsoft/setup-msbuild@v2
48+
- name: Setup NuGet
49+
uses: NuGet/setup-nuget@v2
50+
- name: Setup .NET
51+
uses: actions/setup-dotnet@v4
52+
with:
53+
global-json-file: global.json
54+
55+
- name: Configure the package manifest, logo, and secrets
56+
shell: pwsh
57+
run: |
58+
. './.github/scripts/Configure-AppxManifest.ps1' `
59+
-Branch "SideloadPreview" `
60+
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
61+
-Publisher "$env:SIDELOAD_PUBLISHER_SECRET" `
62+
-WorkingDir "$env:WORKING_DIR" `
63+
-SecretBingMapsKey "$env:SECRET_BINGMAPS_KEY" `
64+
-SecretSentry "$env:SECRET_SENTRY" `
65+
-SecretGitHubOAuthClientId "$env:SECRET_GITHUB_OAUTH_CLIENT_ID"
66+
env:
67+
SIDELOAD_PUBLISHER_SECRET: ${{ secrets.SIDELOAD_PUBLISHER_SECRET }}
68+
SECRET_BINGMAPS_KEY: ${{ secrets.BING_MAPS_SECRET }}
69+
SECRET_SENTRY: ${{ secrets.SENTRY_SECRET }}
70+
SECRET_GITHUB_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
71+
72+
- name: Use Windows SDK Preview
73+
shell: cmd
74+
run: |
75+
for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt
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+
-v:quiet
86+
87+
- name: Build launcher project
88+
shell: pwsh
89+
run: |
90+
msbuild "$env:LAUNCHER_PROJECT_PATH" `
91+
-t:Build `
92+
-p:Platform=$env:PLATFORM `
93+
-p:Configuration=$env:CONFIGURATION `
94+
-v:quiet
95+
96+
- name: Build & package Files
97+
shell: pwsh
98+
run: |
99+
msbuild "$env:PACKAGE_PROJECT_PATH" `
100+
-t:Build `
101+
-t:_GenerateAppxPackage `
102+
-p:Platform=$env:PLATFORM `
103+
-p:Configuration=$env:CONFIGURATION `
104+
-p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS `
105+
-p:AppxPackageDir="$env:APPX_PACKAGE_DIR" `
106+
-p:AppxBundle=Always `
107+
-p:UapAppxPackageBuildMode=Sideload `
108+
-p:GenerateAppInstallerFile=True `
109+
-p:AppInstallerUri=$env:APP_INSTALLER_SIDELOAD_URL `
110+
-v:quiet
111+
112+
- name: Remove empty files from the packages
113+
shell: bash
114+
run: find $ARTIFACTS_STAGING_DIR -empty -delete
115+
116+
- name: Update appinstaller schema
117+
run: |
118+
$newSchema = "http://schemas.microsoft.com/appx/appinstaller/2018"
119+
$localFilePath = "${{ env.APPX_PACKAGE_DIR }}/Files.Package.appinstaller"
120+
$fileContent = Get-Content $localFilePath
121+
$fileContent = $fileContent.Replace("http://schemas.microsoft.com/appx/appinstaller/2017/2", $newSchema)
122+
$fileContent | Set-Content $localFilePath
123+
124+
- name: Sign Files with Azure Trusted Signing
125+
uses: azure/trusted-signing-action@v0.4.0
126+
with:
127+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
128+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
129+
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
130+
endpoint: https://eus.codesigning.azure.net/
131+
trusted-signing-account-name: ${{ secrets.SIGNING_ACCOUNT_NAME }}
132+
certificate-profile-name: ${{ secrets.SIGNING_PROFILE_NAME }}
133+
files-folder: ${{ env.APPX_PACKAGE_DIR }}
134+
files-folder-filter: msixbundle
135+
files-folder-recurse: true
136+
files-folder-depth: 4
137+
file-digest: SHA256
138+
timestamp-rfc3161: http://timestamp.acs.microsoft.com
139+
timestamp-digest: SHA256
140+
141+
- name: Login to Azure
142+
uses: azure/login@v2
143+
with:
144+
creds: ${{ secrets.AZURE_CREDENTIALS }}
145+
146+
- name: Upload to Azure blob storage
147+
uses: azure/powershell@v2
148+
with:
149+
inlineScript: |
150+
az storage blob upload-batch --account-name "filescommunity" --destination "files" --destination-path "preview" --source ${{ env.APPX_PACKAGE_DIR }} --overwrite true
151+
azPSVersion: "latest"
152+
153+
- name: Logout from Azure
154+
run: 'az logout'
155+
156+
- name: Upload the packages to GitHub Actions
157+
uses: actions/upload-artifact@v4
158+
with:
159+
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})'
160+
path: ${{ env.ARTIFACTS_STAGING_DIR }}
+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Copyright (c) Files Community
2+
# Licensed under the MIT License.
3+
4+
# Abstract:
5+
# Deploys Files (Sideload).
6+
#
7+
# Workflow:
8+
# 1. Configure manifest, logo and secrets
9+
# 2. Restore, build and package Files
10+
# 3. Publish the appinstaller to files.community
11+
# 4. Sign the package
12+
# 5. Publish the package to Azure
13+
14+
name: Files CD (Sideload Stable)
15+
16+
on:
17+
workflow_dispatch:
18+
19+
jobs:
20+
build:
21+
runs-on: windows-latest
22+
environment: Deployments
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
configuration: [Release]
27+
platform: [x64]
28+
env:
29+
SOLUTION_NAME: 'Files.slnx'
30+
CONFIGURATION: '${{ matrix.configuration }}'
31+
PLATFORM: '${{ matrix.platform }}'
32+
APPX_BUNDLE_PLATFORMS: 'x64|arm64'
33+
WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\
34+
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'
35+
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages'
36+
PACKAGE_PROJECT_DIR: 'src\Files.App (Package)'
37+
PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj'
38+
PACKAGE_MANIFEST_PATH: 'src\Files.App (Package)\Package.appxmanifest'
39+
LAUNCHER_PROJECT_PATH: 'src\Files.App.Launcher\Files.App.Launcher.vcxproj'
40+
TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj'
41+
APP_INSTALLER_SIDELOAD_URL: 'https://cdn.files.community/files/stable/'
42+
43+
steps:
44+
- name: Checkout the repository
45+
uses: actions/checkout@v4
46+
- name: Setup MSBuild
47+
uses: microsoft/setup-msbuild@v2
48+
- name: Setup NuGet
49+
uses: NuGet/setup-nuget@v2
50+
- name: Setup .NET
51+
uses: actions/setup-dotnet@v4
52+
with:
53+
global-json-file: global.json
54+
55+
- name: Configure the package manifest, logo, and secrets
56+
shell: pwsh
57+
run: |
58+
. './.github/scripts/Configure-AppxManifest.ps1' `
59+
-Branch "SideloadStable" `
60+
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
61+
-Publisher "$env:SIDELOAD_PUBLISHER_SECRET" `
62+
-WorkingDir "$env:WORKING_DIR" `
63+
-SecretBingMapsKey "$env:SECRET_BINGMAPS_KEY" `
64+
-SecretSentry "$env:SECRET_SENTRY" `
65+
-SecretGitHubOAuthClientId "$env:SECRET_GITHUB_OAUTH_CLIENT_ID"
66+
env:
67+
SIDELOAD_PUBLISHER_SECRET: ${{ secrets.SIDELOAD_PUBLISHER_SECRET }}
68+
SECRET_BINGMAPS_KEY: ${{ secrets.BING_MAPS_SECRET }}
69+
SECRET_SENTRY: ${{ secrets.SENTRY_SECRET }}
70+
SECRET_GITHUB_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
71+
72+
- name: Use Windows SDK Preview
73+
shell: cmd
74+
run: |
75+
for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt
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+
-v:quiet
86+
87+
- name: Build launcher project
88+
shell: pwsh
89+
run: |
90+
msbuild "$env:LAUNCHER_PROJECT_PATH" `
91+
-t:Build `
92+
-p:Platform=$env:PLATFORM `
93+
-p:Configuration=$env:CONFIGURATION `
94+
-v:quiet
95+
96+
- name: Build & package Files
97+
shell: pwsh
98+
run: |
99+
msbuild "$env:PACKAGE_PROJECT_PATH" `
100+
-t:Build `
101+
-t:_GenerateAppxPackage `
102+
-p:Platform=$env:PLATFORM `
103+
-p:Configuration=$env:CONFIGURATION `
104+
-p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS `
105+
-p:AppxPackageDir="$env:APPX_PACKAGE_DIR" `
106+
-p:AppxBundle=Always `
107+
-p:UapAppxPackageBuildMode=Sideload `
108+
-p:GenerateAppInstallerFile=True `
109+
-p:AppInstallerUri=$env:APP_INSTALLER_SIDELOAD_URL `
110+
-v:quiet
111+
112+
- name: Remove empty files from the packages
113+
shell: bash
114+
run: find $ARTIFACTS_STAGING_DIR -empty -delete
115+
116+
- name: Update appinstaller schema
117+
run: |
118+
$newSchema = "http://schemas.microsoft.com/appx/appinstaller/2018"
119+
$localFilePath = "${{ env.APPX_PACKAGE_DIR }}/Files.Package.appinstaller"
120+
$fileContent = Get-Content $localFilePath
121+
$fileContent = $fileContent.Replace("http://schemas.microsoft.com/appx/appinstaller/2017/2", $newSchema)
122+
$fileContent | Set-Content $localFilePath
123+
124+
- name: Sign Files with Azure Trusted Signing
125+
uses: azure/trusted-signing-action@v0.4.0
126+
with:
127+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
128+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
129+
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
130+
endpoint: https://eus.codesigning.azure.net/
131+
trusted-signing-account-name: ${{ secrets.SIGNING_ACCOUNT_NAME }}
132+
certificate-profile-name: ${{ secrets.SIGNING_PROFILE_NAME }}
133+
files-folder: ${{ env.APPX_PACKAGE_DIR }}
134+
files-folder-filter: msixbundle
135+
files-folder-recurse: true
136+
files-folder-depth: 4
137+
file-digest: SHA256
138+
timestamp-rfc3161: http://timestamp.acs.microsoft.com
139+
timestamp-digest: SHA256
140+
141+
- name: Login to Azure
142+
uses: azure/login@v2
143+
with:
144+
creds: ${{ secrets.AZURE_CREDENTIALS }}
145+
146+
- name: Upload to Azure blob storage
147+
uses: azure/powershell@v2
148+
with:
149+
inlineScript: |
150+
az storage blob upload-batch --account-name "filescommunity" --destination "files" --destination-path "stable" --source ${{ env.APPX_PACKAGE_DIR }} --overwrite true
151+
azPSVersion: "latest"
152+
153+
- name: Logout from Azure
154+
run: 'az logout'
155+
156+
- name: Upload the packages to GitHub Actions
157+
uses: actions/upload-artifact@v4
158+
with:
159+
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})'
160+
path: ${{ env.ARTIFACTS_STAGING_DIR }}

0 commit comments

Comments
 (0)