|
| 1 | +steps: |
| 2 | +### |
| 3 | +# This step downloads the WindowsAppSDK NuGet package from last successful build of the Aggregator's Nightly build |
| 4 | +# for use in building the installers |
| 5 | +- task: DownloadPipelineArtifact@2 |
| 6 | + displayName: 'Download WindowsAppSDK' |
| 7 | + inputs: |
| 8 | + artifactName: 'WindowsAppSDK_Nuget_And_MSIX' |
| 9 | + targetPath: '$(System.ArtifactsDirectory)' |
| 10 | + source: 'specific' |
| 11 | + project: $(System.TeamProjectId) |
| 12 | + pipeline: 118002 |
| 13 | + runVersion: 'latestFromBranch' |
| 14 | + runBranch: "refs/heads/main" |
| 15 | + |
| 16 | +### |
| 17 | +# Install the internal licensing support for release-signed packages. This can always be present in |
| 18 | +# pipeline builds. The installer code will automatically degrade / skip licenses in non-release builds |
| 19 | + |
| 20 | +# Future: this stage only requires a the app licensing internal package, but is downloading all transport packages |
| 21 | +# used for aggregation consider refactoring for efficiency. |
| 22 | +- task: PowerShell@2 |
| 23 | + name: ConvertVersionDetailsToPackageConfig |
| 24 | + displayName: "Convert VersionDetails To PackageConfig" |
| 25 | + inputs: |
| 26 | + filePath: '$(Build.SourcesDirectory)\build\Scripts\ConvertVersionDetailsToPackageConfig.ps1' |
| 27 | + arguments: -versionDetailsPath '$(Build.SourcesDirectory)\eng\Version.Details.xml' -packageConfigPath '$(Build.SourcesDirectory)\build\packages.config' |
| 28 | + |
| 29 | +- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 |
| 30 | + displayName: RestoreNuGetPackages |
| 31 | + inputs: |
| 32 | + restoreSolution: $(Build.SourcesDirectory)/build/packages.config |
| 33 | + feedsToUse: config |
| 34 | + nugetConfigPath: $(Build.SourcesDirectory)/nuget.config |
| 35 | + restoreDirectory: packages |
| 36 | + |
| 37 | +- task: powershell@2 |
| 38 | + displayName: 'Create test pfx to sign MSIX test packages (DevCheck)' |
| 39 | + inputs: |
| 40 | + targetType: filePath |
| 41 | + filePath: eng\common\DevCheck.ps1 |
| 42 | + arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean |
| 43 | + workingDirectory: '$(Build.SourcesDirectory)' |
| 44 | + |
| 45 | +- task: powershell@2 |
| 46 | + displayName: 'Install test certificate for MSIX test packages (DevCheck)' |
| 47 | + inputs: |
| 48 | + targetType: filePath |
| 49 | + filePath: eng\common\DevCheck.ps1 |
| 50 | + arguments: -NoInteractive -Offline -Verbose -CheckTestCert |
| 51 | + workingDirectory: '$(Build.SourcesDirectory)' |
| 52 | + |
| 53 | +# Copy license files into the InstallerInput directory. License files should be named consistently with the |
| 54 | +# package naming used in the installer. See build\Scripts\ExtractMSIXFromNuget.ps1 for specifics. |
| 55 | +# e.g. |
| 56 | +# main_license.xml, singleton_license.xml, etc. |
| 57 | +- task: CopyFiles@2 |
| 58 | + displayName: 'Copy licenses to target folder' |
| 59 | + inputs: |
| 60 | + SourceFolder: '$(Build.SourcesDirectory)\build\packages\$(AppLicensingInternalPackageName).$(AppLicensingInternalPackageVersion)\licenses' |
| 61 | + Contents: | |
| 62 | + *.xml |
| 63 | + TargetFolder: '$(Build.SourcesDirectory)\InstallerInput' |
| 64 | + flattenFolders: false |
| 65 | + |
| 66 | +# Copy license installation header into the correct installer source location. |
| 67 | +- task: CopyFiles@2 |
| 68 | + displayName: 'Extract files needed for Nuget package' |
| 69 | + inputs: |
| 70 | + SourceFolder: '$(Build.SourcesDirectory)\build\packages\$(AppLicensingInternalPackageName).$(AppLicensingInternalPackageVersion)\src' |
| 71 | + Contents: | |
| 72 | + *.h |
| 73 | + TargetFolder: '$(Build.SourcesDirectory)\installer\dev' |
| 74 | + flattenFolders: false |
| 75 | + overWrite: true |
| 76 | + |
| 77 | +### |
| 78 | +# Copy MSIX packages from build artifacts into the installer content location and create |
| 79 | +# header to include contents into package. |
| 80 | + |
| 81 | +- task: PowerShell@2 |
| 82 | + displayName: ExtractMSIXPackagesFromNuget |
| 83 | + inputs: |
| 84 | + filePath: '$(Build.SourcesDirectory)\build\scripts\ExtractMSIXFromNuget.ps1' |
| 85 | + arguments: > |
| 86 | + -Source '$(System.ArtifactsDirectory)' |
| 87 | + -Dest '$(Build.SourcesDirectory)\InstallerInput' |
| 88 | +
|
| 89 | +- task: PowerShell@2 |
| 90 | + displayName: CreateInstallerOverrideHeader |
| 91 | + inputs: |
| 92 | + filePath: '$(Build.SourcesDirectory)\build\Scripts\CreateInstallerOverrideHeader.ps1' |
| 93 | + arguments: > |
| 94 | + -SourceFolder '$(Build.SourcesDirectory)\InstallerInput' |
| 95 | + -DestinationFolder '$(Build.SourcesDirectory)\InstallerInput' |
| 96 | +
|
| 97 | +# NuGetCommand@2 |
| 98 | +- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 |
| 99 | + displayName: 'Restore Windows App Runtime Install Nuget' |
| 100 | + inputs: |
| 101 | + command: 'restore' |
| 102 | + restoreSolution: installer\WindowsAppRuntimeInstall.sln |
| 103 | + feedsToUse: config |
| 104 | + nugetConfigPath: $(Build.SourcesDirectory)\nuget.config |
| 105 | + |
| 106 | +- task: CopyFiles@2 |
| 107 | + displayName: 'Copy installer override header' |
| 108 | + inputs: |
| 109 | + SourceFolder: '$(Build.SourcesDirectory)\InstallerInput' |
| 110 | + Contents: | |
| 111 | + windowsappruntime_definitions_override.h |
| 112 | + TargetFolder: installer\dev |
| 113 | + flattenFolders: false |
| 114 | + |
| 115 | +- task: NuGetAuthenticate@1 |
| 116 | + displayName: "NuGet authenticate to restore Microsoft.Telemetry.Inbox.Native" |
| 117 | + inputs: |
| 118 | + nuGetServiceConnections: "TelemetryInternal" |
| 119 | + |
| 120 | +# NuGetCommand@2 |
| 121 | +- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 |
| 122 | + displayName: "NuGet restore Microsoft.Telemetry.Inbox.Native package" |
| 123 | + inputs: |
| 124 | + command: "custom" |
| 125 | + arguments: |
| 126 | + 'restore $(Build.SourcesDirectory)\installer\dev\telemetry\packages.config -ConfigFile $(Build.SourcesDirectory)\nuget.config -PackagesDirectory $(Build.SourcesDirectory)\packages' |
| 127 | + |
| 128 | +# Overwrite wil\Traceloggingconfig.h content in public nuget with that of MicrosoftTelemetry.h from internal nuget |
| 129 | +# This step enables telemetry in the Installer |
| 130 | +- task: powershell@2 |
| 131 | + name: OverwriteWILTraceLoggingWithMicrosoftInternalContent |
| 132 | + inputs: |
| 133 | + targetType: "inline" |
| 134 | + script: | |
| 135 | + $srcPath = Get-Childitem -Path '$(Build.SourcesDirectory)\packages\' -File 'MicrosoftTelemetry.h' -Recurse |
| 136 | + if ($srcPath -ne $null) |
| 137 | + { |
| 138 | + $destinationPaths = Get-Childitem -Path '$(Build.SourcesDirectory)\packages\' -File 'Traceloggingconfig.h' -Recurse |
| 139 | + if ($destinationPaths -ne $null) |
| 140 | + { |
| 141 | + foreach ($destPath in $destinationPaths) |
| 142 | + { |
| 143 | + Copy-Item -Force $srcPath.FullName $destPath.FullName |
| 144 | + } |
| 145 | + } |
| 146 | + else |
| 147 | + { |
| 148 | + Write-Host Did not find the destination wil/traceloggingconfig.h under $(Build.SourcesDirectory)\packages\ |
| 149 | + Get-Childitem -Path '$(Build.SourcesDirectory)\packages\' -Recurse |
| 150 | + } |
| 151 | + } |
| 152 | + else |
| 153 | + { |
| 154 | + Write-Host Did not find the source MicrosoftTelemetry.h under $(Build.SourcesDirectory)\packages\ |
| 155 | + Get-Childitem -Path '$(Build.SourcesDirectory)\packages\' -Recurse |
| 156 | + } |
| 157 | +
|
| 158 | +# Extract Microsoft.WindowsAppSDK Nuget package artifact published by BuildWindowsAppSDKPackages job of Aggregate stage, |
| 159 | +# that runs before the current CreateInstaller stage in the same build pipeline, to the installer's packages folder. |
| 160 | +# And copy WindowsAppSDK-VersionInfo.h from the extracted nuget package to installer's project folder |
| 161 | +- task: powershell@2 |
| 162 | + name: ExtractWinAppSDKNugetPackage |
| 163 | + inputs: |
| 164 | + targetType: "inline" |
| 165 | + script: | |
| 166 | + $srcWinAppSDKNupkgPath = Get-Childitem -Path '$(System.ArtifactsDirectory)\NugetPackages' -File '*Microsoft.WindowsAppSDK*' |
| 167 | + Copy-Item -Force $srcWinAppSDKNupkgPath.FullName '$(Build.SourcesDirectory)\packages\' |
| 168 | + $destWinAppSDKNupkgPath = Get-Childitem -Path '$(Build.SourcesDirectory)\packages\' -File '*Microsoft.WindowsAppSDK*' |
| 169 | + $winAppSDKZip = $destWinAppSDKNupkgPath.FullName -replace '.nupkg','.zip' |
| 170 | + Rename-Item -Path $destWinAppSDKNupkgPath.FullName -NewName $winAppSDKZip |
| 171 | + Expand-Archive $winAppSDKZip -DestinationPath ($destWinAppSDKNupkgPath.Directory.FullName + '\' + $destWinAppSDKNupkgPath.BaseName) |
| 172 | + Copy-Item -Force ($destWinAppSDKNupkgPath.Directory.FullName + '\' + $destWinAppSDKNupkgPath.BaseName + "\include\WindowsAppSDK-VersionInfo.h") '$(Build.SourcesDirectory)\installer\dev\' |
| 173 | +
|
| 174 | +- task: WinUndockNativeCompiler@1 |
| 175 | + displayName: 'Setup native compiler version override' |
| 176 | + inputs: |
| 177 | + microsoftDropReadPat: $(System.AccessToken) |
| 178 | + compilerPackageName: $(compilerOverridePackageName) |
| 179 | + compilerPackageVersion: $(compilerOverridePackageVersion) |
| 180 | + slnDirectory: $(Build.SourcesDirectory)\installer\dev |
| 181 | + |
| 182 | +- task: VSBuild@1 |
| 183 | + displayName: 'Build Windows App Runtime Install' |
| 184 | + inputs: |
| 185 | + solution: installer\dev\WindowsAppRuntimeInstall.vcxproj |
| 186 | + platform: '$(buildPlatform)' |
| 187 | + configuration: '$(buildConfiguration)' |
| 188 | + |
| 189 | +- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
| 190 | + displayName: 'Component Governance Detection' |
| 191 | + inputs: |
| 192 | + scanType: 'Register' |
| 193 | + failOnAlert: true |
| 194 | + |
| 195 | +- task: CopyFiles@2 |
| 196 | + displayName: 'Publish Installer' |
| 197 | + inputs: |
| 198 | + SourceFolder: 'BuildOutput' |
| 199 | + TargetFolder: '$(ob_outputDirectory)\Installer' |
| 200 | + |
| 201 | +- task: powershell@2 |
| 202 | + displayName: 'Remove test certificate for MSIX test packages (DevCheck)' |
| 203 | + inputs: |
| 204 | + targetType: filePath |
| 205 | + filePath: eng\common\DevCheck.ps1 |
| 206 | + arguments: -NoInteractive -Offline -Verbose -RemoveTestCert -RemoveTestPfx |
| 207 | + workingDirectory: '$(Build.SourcesDirectory)' |
| 208 | + |
| 209 | +- task: PublishBuildArtifacts@1 |
| 210 | + inputs: |
| 211 | + PathtoPublish: '$(ob_outputDirectory)' |
| 212 | + artifactName: '$(ob_artifactBaseName)' |
0 commit comments