Test to bump minVerson only for release pipeline

This commit is contained in:
Kenny Guo 2021-07-26 23:15:25 +08:00
commit af1c7a8b6e
4 changed files with 55 additions and 1 deletions

View file

@ -0,0 +1,33 @@
#
# Continuous Integration (CI) - Internal
# This pipeline builds and validate the app for all supported architectures, in a production
# configuration. This pipeline relies on Microsoft-internal resources to run.
#
trigger: none
pr: none
name: 0.$(Date:yyMM).$(DayOfMonth)$(Rev:rr).0
jobs:
- template: ./templates/build-app-internal.yaml
parameters:
platform: x64
isPublicRelease: true
- template: ./templates/build-app-internal.yaml
parameters:
platform: x86
isPublicRelease: true
- template: ./templates/build-app-internal.yaml
parameters:
platform: ARM
isPublicRelease: true
- template: ./templates/run-ui-tests.yaml
parameters:
platform: x64
runsettingsFileName: CalculatorUITests.release.runsettings
- template: ./templates/package-appxbundle.yaml

View file

@ -6,6 +6,7 @@
parameters:
platform: ''
condition: ''
isPublicRelease: false
jobs:
- job: Build${{ parameters.platform }}
@ -32,6 +33,7 @@ jobs:
- template: ./build-single-architecture.yaml
parameters:
extraMsBuildArgs: '/p:IsStoreBuild=true'
isPublicRelease: ${{ parameters.isPublicRelease }}
- task: PublishSymbols@2
displayName: Publish symbols

View file

@ -3,6 +3,7 @@
parameters:
extraMsBuildArgs: ''
isPublicRelease: false
steps:
- task: NuGetToolInstaller@1
@ -22,7 +23,11 @@ steps:
displayName: Set version number in AppxManifest
inputs:
filePath: $(Build.SourcesDirectory)\build\scripts\UpdateAppxManifestVersion.ps1
arguments: '-AppxManifest $(Build.SourcesDirectory)\src\Calculator\Package.appxmanifest -Version $(Build.BuildNumber)'
arguments: versionArgs
${{ if eq(parameters.isPublicRelease, true) }}:
versionArgs: '-AppxManifest $(Build.SourcesDirectory)\src\Calculator\Package.appxmanifest -Version $(Build.BuildNumber) -MinVersion 10.0.22000.0'
${{ if eq(parameters.isPublicRelease, false) }}:
versionArgs: '-AppxManifest $(Build.SourcesDirectory)\src\Calculator\Package.appxmanifest -Version $(Build.BuildNumber)'
- task: VSBuild@1
displayName: 'Build solution src/Calculator.sln'

View file

@ -11,6 +11,9 @@
.PARAMETER Version
The version number to write into the file.
.PARAMETER MinVersion
The MinVersion to write to TargetDeviceFamily element in the file.
.EXAMPLE
Update-AppxManifestVersion -AppxManifest "C:\App\Package.appxmanifest" -Version "3.2.1.0"
#>
@ -24,8 +27,19 @@ param(
[Parameter(Mandatory)]
[string]
$Version
[ValidateScript({[version]$_})]
[Parameter(Mandatory=$false)]
[string]
$MinVersion
)
$xmlDoc = [XML](Get-Content $AppxManifest)
$xmlDoc.Package.Identity.setAttribute("Version", $Version);
if($MinVersion)
{
$xmlDoc.Package.Dependencies.TargetDeviceFamily.setAttribute("MinVersion", $MinVersion);
}
$xmlDoc.Save($AppxManifest)