Skip to content

Commit 58d122d

Browse files
authored
CI: Created release-preview pipeline (#11943)
1 parent 38c43a8 commit 58d122d

File tree

2 files changed

+135
-8
lines changed

2 files changed

+135
-8
lines changed

builds/azure-pipelines-preview.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
trigger: none
2+
pr: none
3+
4+
pool:
5+
vmImage: 'windows-latest'
6+
7+
variables:
8+
- group: BuildPipelineVariables
9+
- name: solution
10+
value: '**/*.sln'
11+
- name: buildPlatform
12+
value: 'x64|ARM64'
13+
- name: buildConfiguration
14+
value: 'Release'
15+
- name: sideloadBuildConfiguration
16+
value: 'Sideload'
17+
- name: appxPackageDir
18+
value: '$(build.artifactStagingDirectory)\AppxPackages\\'
19+
20+
jobs:
21+
### Sideload release ###
22+
- job: SideloadRelease
23+
timeoutInMinutes: 120
24+
steps:
25+
- task: PowerShell@2
26+
inputs:
27+
targetType: 'inline'
28+
script: |
29+
[xml]$xmlDoc = Get-Content '$(Build.SourcesDirectory)\src\Files.App (Package)\Package.appxmanifest'
30+
$xmlDoc.Package.Identity.Name="FilesPreview"
31+
$xmlDoc.Package.Identity.Publisher="Files"
32+
$xmlDoc.Package.Properties.DisplayName="Files - Preview"
33+
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview"
34+
$xmlDoc.Save('$(Build.SourcesDirectory)\src\Files.App (Package)\Package.appxmanifest')
35+
failOnStderr: true
36+
37+
# This replaces references to the dev icon with the specified icon variant
38+
- task: PowerShell@2
39+
displayName: 'Use Correct Logo'
40+
inputs:
41+
targetType: 'inline'
42+
script: |
43+
gci $(Build.SourcesDirectory)\src -Include *.csproj, *.appxmanifest, *.wapproj -recurse | ForEach -Process {
44+
(Get-Content $_ -Raw | ForEach -Process {$_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview"}) | Set-Content $_ -NoNewline
45+
}
46+
failOnStderr: true
47+
48+
- task: DownloadSecureFile@1
49+
name: mapsDevKey
50+
displayName: 'Download Bing Maps Dev Key'
51+
inputs:
52+
secureFile: 'BingMapsKey.txt'
53+
54+
# Adds the Bing maps token to the project
55+
- task: CopyFiles@2
56+
inputs:
57+
SourceFolder: '$(Agent.TempDirectory)'
58+
Contents: '$(mapsDevKey.secureFilePath)'
59+
TargetFolder: '$(Build.SourcesDirectory)\src\Files.App\Resources'
60+
overWrite: true
61+
62+
# Injects the AppCenter token to the project
63+
- task: PowerShell@2
64+
displayName: 'Inject AppCenter token'
65+
inputs:
66+
targetType: 'inline'
67+
script: |
68+
gci $(Build.SourcesDirectory)\src -Include *.cs -recurse | ForEach -Process {
69+
(Get-Content $_ -Raw | ForEach -Process {$_ -replace "appcenter.secret", "$(appcenter.secret)"}) | Set-Content $_ -NoNewline
70+
}
71+
failOnStderr: true
72+
73+
- task: UseDotNet@2
74+
inputs:
75+
packageType: sdk
76+
version: 7.0.x
77+
includePreviewVersions: true
78+
79+
- task: CmdLine@2
80+
inputs:
81+
script: |
82+
for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt
83+
84+
- task: MSBuild@1
85+
inputs:
86+
platform: 'x64'
87+
solution: '$(solution)'
88+
configuration: '$(sideloadBuildConfiguration)'
89+
msbuildArguments: '/t:restore /p:Configuration="$(sideloadBuildConfiguration)";Platform="$(buildPlatform)";PublishReadyToRun=true'
90+
maximumCpuCount: true
91+
92+
- task: DownloadSecureFile@1
93+
name: caCertificate
94+
displayName: 'Download CA certificate'
95+
inputs:
96+
secureFile: '$(signingCert.secureFilePath)'
97+
98+
- task: MSBuild@1
99+
inputs:
100+
solution: '**/*.wapproj'
101+
platform: 'x64'
102+
configuration: '$(sideloadBuildConfiguration)'
103+
msbuildArguments: '/t:build;_GenerateAppxPackage /p:AppxLogTelemetryFromSideloadingScript=False /p:GenerateAppInstallerFile=True /p:AppInstallerUri=https://cdn.files.community/files/preview/ /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=Sideload /p:AppxPackageSigningEnabled=true /p:PackageCertificateKeyFile="$(caCertificate.secureFilePath)" /p:PackageCertificatePassword="$(signingCert.password)" /p:PackageCertificateThumbprint=""'
104+
maximumCpuCount: true
105+
106+
- task: CopyFiles@2
107+
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
108+
inputs:
109+
SourceFolder: '$(system.defaultworkingdirectory)'
110+
Contents: '**\bin\$(sideloadBuildConfiguration)\**'
111+
TargetFolder: '$(build.artifactstagingdirectory)'
112+
113+
- task: PublishBuildArtifacts@1
114+
displayName: 'Publish Artifact: Sideload'
115+
inputs:
116+
PathtoPublish: '$(build.artifactstagingdirectory)'
117+
ArtifactName: 'Sideload'
118+
publishLocation: 'Container'
119+
120+
- task: AzureFileCopy@4
121+
inputs:
122+
SourcePath: '$(build.artifactstagingdirectory)\AppxPackages\*'
123+
azureSubscription: 'azureconnection'
124+
Destination: 'AzureBlob'
125+
storage: 'filescommunity'
126+
ContainerName: 'files'
127+
BlobPrefix: 'preview'

builds/azure-pipelines-release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@ parameters:
88
- name: releaseBranch
99
displayName: Release Branch
1010
type: string
11-
default: 'preview'
11+
default: 'stable'
1212
values:
13-
- 'preview'
1413
- 'stable'
14+
- 'preview'
1515
- name: packageIdentityName
1616
displayName: Package Identity Name
1717
type: string
18-
default: 'FilesPreview'
18+
default: 'Files'
1919
values:
20-
- 'FilesPreview'
2120
- 'Files'
21+
- 'FilesPreview'
2222
- name: packageDisplayName
2323
displayName: Package Display Name
2424
type: string
25-
default: 'Files (Preview)'
25+
default: 'Files'
2626
values:
27-
- 'Files (Preview)'
2827
- 'Files'
28+
- 'Files - Preview'
2929
- name: iconVariant
3030
displayName: Icon Variant
3131
type: string
32-
default: 'Preview'
32+
default: 'Release'
3333
values:
34-
- 'Preview'
3534
- 'Release'
35+
- 'Preview'
3636

3737
variables:
3838
- group: BuildPipelineVariables

0 commit comments

Comments
 (0)