From af1c7a8b6ea39c39c5fcae7daccd7203c8490251 Mon Sep 17 00:00:00 2001 From: Kenny Guo Date: Mon, 26 Jul 2021 23:15:25 +0800 Subject: [PATCH] Test to bump minVerson only for release pipeline --- .../azure-pipelines.release.test.yaml | 33 +++++++++++++++++++ .../templates/build-app-internal.yaml | 2 ++ .../templates/build-single-architecture.yaml | 7 +++- build/scripts/UpdateAppxManifestVersion.ps1 | 14 ++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 build/pipelines/azure-pipelines.release.test.yaml diff --git a/build/pipelines/azure-pipelines.release.test.yaml b/build/pipelines/azure-pipelines.release.test.yaml new file mode 100644 index 00000000..84ee1fc9 --- /dev/null +++ b/build/pipelines/azure-pipelines.release.test.yaml @@ -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 diff --git a/build/pipelines/templates/build-app-internal.yaml b/build/pipelines/templates/build-app-internal.yaml index 48a63b5d..4c9dcd35 100644 --- a/build/pipelines/templates/build-app-internal.yaml +++ b/build/pipelines/templates/build-app-internal.yaml @@ -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 diff --git a/build/pipelines/templates/build-single-architecture.yaml b/build/pipelines/templates/build-single-architecture.yaml index eb9bf805..e35ca0cb 100644 --- a/build/pipelines/templates/build-single-architecture.yaml +++ b/build/pipelines/templates/build-single-architecture.yaml @@ -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' diff --git a/build/scripts/UpdateAppxManifestVersion.ps1 b/build/scripts/UpdateAppxManifestVersion.ps1 index 1c6bc5dd..e20b9203 100644 --- a/build/scripts/UpdateAppxManifestVersion.ps1 +++ b/build/scripts/UpdateAppxManifestVersion.ps1 @@ -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) \ No newline at end of file