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'
0 commit comments