Skip to content

Commit 0810f55

Browse files
authored
Revert CD improvements
1 parent 04b23d2 commit 0810f55

File tree

5 files changed

+550
-196
lines changed

5 files changed

+550
-196
lines changed
+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/#@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/#@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)