2021-08-26 23:47:10 +08:00
|
|
|
# This template contains a job to build the app for a single architecture.
|
2019-01-29 08:24:37 +08:00
|
|
|
|
|
|
|
parameters:
|
2021-08-26 23:47:10 +08:00
|
|
|
isReleaseBuild: false
|
2021-09-08 23:40:05 +08:00
|
|
|
useReleaseAppxManifest: false
|
2021-08-26 23:47:10 +08:00
|
|
|
platform: ''
|
|
|
|
condition: ''
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: Build${{ parameters.platform }}
|
|
|
|
displayName: Build ${{ parameters.platform }}
|
|
|
|
condition: ${{ parameters.condition }}
|
|
|
|
pool:
|
|
|
|
vmImage: windows-2019
|
|
|
|
variables:
|
|
|
|
BuildConfiguration: Release
|
|
|
|
BuildPlatform: ${{ parameters.platform }}
|
|
|
|
${{ if eq(parameters.isReleaseBuild, true) }}:
|
2021-09-08 23:40:05 +08:00
|
|
|
${{ if eq(parameters.useReleaseAppxManifest, true) }}:
|
|
|
|
ExtraMSBuildArgs: '/p:IsStoreBuild=true /p:UseReleaseAppxManifest=true'
|
|
|
|
${{ if eq(parameters.useReleaseAppxManifest, false) }}:
|
|
|
|
ExtraMSBuildArgs: '/p:IsStoreBuild=true'
|
2021-08-26 23:47:10 +08:00
|
|
|
${{ if eq(parameters.isReleaseBuild, false) }}:
|
2021-09-08 23:40:05 +08:00
|
|
|
${{ if eq(parameters.useReleaseAppxManifest, true) }}:
|
|
|
|
ExtraMSBuildArgs: '/p:UseReleaseAppxManifest=true'
|
|
|
|
${{ if eq(parameters.useReleaseAppxManifest, false) }}:
|
|
|
|
ExtraMSBuildArgs: ''
|
2021-09-28 09:24:49 +08:00
|
|
|
${{ if eq(parameters.useReleaseAppxManifest, false) }}:
|
|
|
|
ManifestFileName: 'Package.appxmanifest'
|
|
|
|
${{ if eq(parameters.useReleaseAppxManifest, true) }}:
|
|
|
|
ManifestFileName: 'Package.Release.appxmanifest'
|
2021-08-26 23:47:10 +08:00
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
fetchDepth: 1
|
|
|
|
|
|
|
|
- ${{ if eq(parameters.isReleaseBuild, true) }}:
|
|
|
|
- task: UniversalPackages@0
|
|
|
|
displayName: Download internals package
|
|
|
|
inputs:
|
|
|
|
command: download
|
|
|
|
downloadDirectory: $(Build.SourcesDirectory)
|
|
|
|
vstsFeed: WindowsInboxApps
|
|
|
|
vstsFeedPackage: calculator-internals
|
2021-09-08 23:40:05 +08:00
|
|
|
vstsPackageVersion: 0.0.67
|
2019-01-29 08:24:37 +08:00
|
|
|
|
2020-06-05 01:19:27 +08:00
|
|
|
- task: NuGetToolInstaller@1
|
|
|
|
displayName: Use NuGet 5.x
|
2019-01-29 08:24:37 +08:00
|
|
|
inputs:
|
2020-06-05 01:19:27 +08:00
|
|
|
versionSpec: 5.x
|
2019-01-29 08:24:37 +08:00
|
|
|
|
2022-01-05 00:07:41 +08:00
|
|
|
- task: NuGetCommand@2
|
2019-01-29 08:24:37 +08:00
|
|
|
displayName: NuGet restore src/Calculator.sln
|
|
|
|
inputs:
|
|
|
|
command: custom
|
2020-06-05 01:19:27 +08:00
|
|
|
arguments: restore src/Calculator.sln -Verbosity Detailed
|
2019-01-29 08:24:37 +08:00
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: Set version number in AppxManifest
|
|
|
|
inputs:
|
|
|
|
filePath: $(Build.SourcesDirectory)\build\scripts\UpdateAppxManifestVersion.ps1
|
2021-09-28 09:24:49 +08:00
|
|
|
arguments: '-AppxManifest $(Build.SourcesDirectory)\src\Calculator\$(ManifestFileName) -Version $(Build.BuildNumber)'
|
2019-01-29 08:24:37 +08:00
|
|
|
|
|
|
|
- task: VSBuild@1
|
|
|
|
displayName: 'Build solution src/Calculator.sln'
|
|
|
|
inputs:
|
|
|
|
solution: src/Calculator.sln
|
2019-06-25 07:38:45 +08:00
|
|
|
vsVersion: 16.0
|
2021-08-26 23:47:10 +08:00
|
|
|
msbuildArgs: /bl:$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator.binlog /p:OutDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\ /p:GenerateProjectSpecificOutputFolder=true /p:Version=$(Build.BuildNumber) /t:Publish /p:PublishDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\publish\ $(ExtraMSBuildArgs)
|
2019-01-29 08:24:37 +08:00
|
|
|
platform: $(BuildPlatform)
|
|
|
|
configuration: $(BuildConfiguration)
|
|
|
|
maximumCpuCount: true
|
|
|
|
|
2022-01-14 14:16:12 +08:00
|
|
|
- ${{ if eq(parameters.isReleaseBuild, true) }}:
|
|
|
|
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
|
|
|
displayName: 'Generate Software Bill of Material(SBoM)'
|
|
|
|
inputs:
|
|
|
|
BuildDropPath: $(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator
|
|
|
|
PackageName: 'Microsoft.WindowsCalculator'
|
|
|
|
PackageVersion: $(Build.BuildNumber)
|
|
|
|
|
2019-01-29 08:24:37 +08:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: Publish drop artifact
|
|
|
|
inputs:
|
|
|
|
artifactName: drop
|
|
|
|
pathToPublish: $(Build.BinariesDirectory)
|
|
|
|
parallel: true
|
2021-08-26 23:47:10 +08:00
|
|
|
|
|
|
|
- ${{ if eq(parameters.isReleaseBuild, true) }}:
|
|
|
|
- task: PublishSymbols@2
|
|
|
|
displayName: Publish symbols
|
|
|
|
inputs:
|
|
|
|
symbolsFolder: $(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)
|
|
|
|
searchPattern: '**/*.pdb'
|
|
|
|
symbolServerType: teamServices
|
|
|
|
treatNotIndexedAsWarning: true
|
|
|
|
symbolsArtifactName: $(System.teamProject)/$(Build.BuildNumber)_$(BuildPlatform)$(BuildConfiguration)
|
|
|
|
|
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: Copy Files for BinSkim analysis
|
|
|
|
inputs:
|
|
|
|
SourceFolder: '$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator\'
|
|
|
|
# Setting up a folder to store all the binary files that we need BinSkim to scan.
|
|
|
|
# If we put more things than we produce pdbs for and can index (such as nuget packages that ship without pdbs), binskim will fail.
|
|
|
|
# Below are ignored files
|
|
|
|
# - clrcompression.dll
|
|
|
|
Contents: |
|
|
|
|
**\*
|
|
|
|
!**\clrcompression.dll
|
|
|
|
TargetFolder: '$(Agent.BuildDirectory)\binskim'
|
|
|
|
CleanTargetFolder: true
|
|
|
|
OverWrite: true
|
|
|
|
flattenFolders: false
|
|
|
|
analyzeTarget: '$(Agent.BuildDirectory)\binskim\*'
|
|
|
|
|
|
|
|
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3
|
|
|
|
displayName: Run BinSkim
|
|
|
|
inputs:
|
|
|
|
inputType: Basic
|
|
|
|
analyzeTarget: '$(Agent.BuildDirectory)\binskim\*'
|
|
|
|
analyzeVerbose: true
|
|
|
|
analyzeHashes: true
|
|
|
|
continueOnError: true
|
|
|
|
|
|
|
|
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1
|
|
|
|
displayName: Run PoliCheck
|
|
|
|
inputs:
|
|
|
|
targetType: F
|
|
|
|
|
|
|
|
- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2
|
|
|
|
displayName: Publish security analysis logs
|
|
|
|
|
|
|
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
|
|
|
displayName: Detect open source components
|
|
|
|
inputs:
|
2022-01-05 00:07:41 +08:00
|
|
|
sourceScanPath: $(Agent.BuildDirectory)
|