-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
152 lines (136 loc) · 5.14 KB
/
Copy pathcd-store-preview.yml
File metadata and controls
152 lines (136 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Copyright (c) Files Community
# Licensed under the MIT License.
# Abstract:
# Deploys Files Preview (Store).
#
# Workflow:
# 1. Configure manifest, logo and secrets
# 2. Restore, build and package Files
# 3. Generate a msixupload file
# 4. Publish the msixupload to GitHub Actions
name: Files CD (Store Preview)
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-2025-vs2026
environment: Deployments
strategy:
fail-fast: false
matrix:
configuration: [Release]
platform: [x64]
env:
SOLUTION_NAME: 'Files.slnx'
CONFIGURATION: '${{ matrix.configuration }}'
PLATFORM: '${{ matrix.platform }}'
APPX_BUNDLE_PLATFORMS: 'x64|arm64'
WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages\'
APP_PROJECT_PATH: '${{ github.workspace }}\src\Files.App\Files.App.csproj'
PACKAGE_MANIFEST_PATH: '${{ github.workspace }}\src\Files.App\Package.appxmanifest'
LAUNCHER_PROJECT_PATH: 'src\Files.App.Launcher\Files.App.Launcher.vcxproj'
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v3
- name: Setup NuGet
uses: NuGet/setup-nuget@v3
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Configure the package manifest, logo, and secrets
shell: pwsh
run: |
. './.github/scripts/Configure-AppxManifest.ps1' `
-Branch "StorePreview" `
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
-Publisher "$env:STORE_PUBLISHER_SECRET" `
-WorkingDir "$env:WORKING_DIR" `
-SecretBingMapsKey "$env:SECRET_BINGMAPS_KEY" `
-SecretSentry "$env:SECRET_SENTRY" `
-SecretGitHubOAuthClientId "$env:SECRET_GITHUB_OAUTH_CLIENT_ID"
env:
STORE_PUBLISHER_SECRET: ${{ secrets.STORE_PUBLISHER_SECRET }}
SECRET_BINGMAPS_KEY: ${{ secrets.BING_MAPS_SECRET }}
SECRET_SENTRY: ${{ secrets.SENTRY_SECRET }}
SECRET_GITHUB_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
- name: Restore Files
shell: pwsh
run: |
msbuild $env:SOLUTION_NAME `
-t:Restore `
-p:Platform=$env:PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-p:PublishReadyToRun=true `
-v:quiet
- name: Restore NuGet Packages for Launcher Project
shell: pwsh
run: |
nuget restore "$env:LAUNCHER_PROJECT_PATH" `
-SolutionDirectory "$env:WORKING_DIR" `
-Verbosity detailed
- name: Build launcher project
shell: pwsh
run: |
msbuild "$env:LAUNCHER_PROJECT_PATH" `
-t:Build `
-p:Platform=$env:PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-v:quiet
- name: Hide NuGet.Config from signing action
shell: pwsh
run: Move-Item NuGet.Config NuGet.Config.bak
- name: Sign launcher EXE with Azure Trusted Signing
uses: Azure/artifact-signing-action@v1
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://eus.codesigning.azure.net/
signing-account-name: ${{ secrets.SIGNING_ACCOUNT_NAME }}
certificate-profile-name: ${{ secrets.SIGNING_PROFILE_NAME }}
files-folder: ${{ github.workspace }}\src\Files.App\Assets\FilesOpenDialog
files-folder-filter: "*.exe"
files-folder-recurse: false
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Restore NuGet.Config
if: always()
shell: pwsh
run: Move-Item NuGet.Config.bak NuGet.Config
- name: Build & package Files
shell: pwsh
run: |
$platforms = "$env:APPX_BUNDLE_PLATFORMS" -split '\|'
foreach ($plat in $platforms) {
Write-Host "Building for $plat..."
msbuild "$env:APP_PROJECT_PATH" `
-t:Build `
-p:Platform=$plat `
-p:Configuration=$env:CONFIGURATION `
-p:AppxPackageDir="$env:APPX_PACKAGE_DIR" `
-p:AppxBundle=Never `
-p:GenerateAppxPackageOnBuild=true `
-p:UapAppxPackageBuildMode=StoreUpload `
-v:quiet
}
- name: Create msixbundle and msixupload
shell: pwsh
run: |
. './.github/scripts/Create-MsixBundle.ps1' `
-AppxPackageDir "$env:APPX_PACKAGE_DIR" `
-BundleName "Files.Package" `
-BuildMode "StoreUpload"
- name: Remove empty files from the packages
shell: bash
run: find $ARTIFACTS_STAGING_DIR -empty -delete
- name: Upload the packages to GitHub Actions
uses: actions/upload-artifact@v7
with:
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})'
path: ${{ env.ARTIFACTS_STAGING_DIR }}