From b1df329d9ec88d572b0cb5c1dd0fbe65f71c0de1 Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Thu, 26 Oct 2023 00:26:03 +0800 Subject: [PATCH] fix yaml --- .../templates/build-single-architecture.yaml | 4 +- .../templates/package-msixbundle.yaml | 43 ++++++++++++++----- build/pipelines/templates/release-store.yaml | 5 +-- build/pipelines/templates/release-vpack.yaml | 5 +-- build/pipelines/templates/run-ui-tests.yaml | 23 +++++----- build/pipelines/templates/run-unit-tests.yaml | 11 ++--- 6 files changed, 57 insertions(+), 34 deletions(-) diff --git a/build/pipelines/templates/build-single-architecture.yaml b/build/pipelines/templates/build-single-architecture.yaml index c0247ae1..14f59a21 100644 --- a/build/pipelines/templates/build-single-architecture.yaml +++ b/build/pipelines/templates/build-single-architecture.yaml @@ -31,8 +31,8 @@ jobs: outputs: - output: pipelineArtifact displayName: Publish drop artifact - targetPath: $(Build.BinariesDirectory) - artifactName: drop + targetPath: $(Build.BinariesDirectory)\$(BuildConfiguration)\${{ parameters.platform }} + artifactName: drop-${{ parameters.platform }} steps: - checkout: self diff --git a/build/pipelines/templates/package-msixbundle.yaml b/build/pipelines/templates/package-msixbundle.yaml index 1519b114..8c8c0174 100644 --- a/build/pipelines/templates/package-msixbundle.yaml +++ b/build/pipelines/templates/package-msixbundle.yaml @@ -3,7 +3,6 @@ # this job also signs the bundle and creates StoreBroker packages. parameters: - isOSSBuild: false signBundle: false createStoreBrokerPackages: false @@ -22,15 +21,14 @@ jobs: in(dependencies.BuildARM.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'), in(dependencies.BuildARM64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped') ) - pool: - ${{ if eq(parameters.isOSSBuild, true) }}: - name: EssentialExperiencesOpenSource-windows-2022 - ${{ if eq(parameters.isOSSBuild, false) }}: - name: EssentialExperiences-windows-2022 variables: skipComponentGovernanceDetection: true StoreBrokerMediaRootPath: $(TEMP)\SBMedia StoreBrokerPackagePath: $(Build.ArtifactStagingDirectory)\storeBrokerPayload + PackageX86: $[in(dependencies.Buildx86.result, 'Succeeded', 'SucceededWithIssues')] + PackageX64: $[in(dependencies.Buildx64.result, 'Succeeded', 'SucceededWithIssues')] + PackageARM: $[in(dependencies.BuildARM.result, 'Succeeded', 'SucceededWithIssues')] + PackageARM64: $[in(dependencies.BuildARM64.result, 'Succeeded', 'SucceededWithIssues')] templateContext: outputs: - ${{ if eq(parameters.signBundle, true) }}: @@ -53,12 +51,37 @@ jobs: - checkout: self fetchDepth: 1 - - task: DownloadBuildArtifacts@0 - displayName: Download all .msix artifacts + - task: DownloadPipelineArtifacts@2 + displayName: Download all .msix artifacts (x86) + condition: and(succeeded(), eq(variables.PackageX86, 'true')) inputs: - artifactName: drop + artifactName: drop-x86 itemPattern: '**/*.msix' - targetPath: $(Build.ArtifactStagingDirectory) + targetPath: $(Build.ArtifactStagingDirectory)\drop\x86 + + - task: DownloadPipelineArtifacts@2 + displayName: Download all .msix artifacts (x64) + condition: and(succeeded(), eq(variables.PackageX64, 'true')) + inputs: + artifactName: drop-x64 + itemPattern: '**/*.msix' + targetPath: $(Build.ArtifactStagingDirectory)\drop\x64 + + - task: DownloadPipelineArtifacts@2 + displayName: Download all .msix artifacts (ARM) + condition: and(succeeded(), eq(variables.PackageARM, 'true')) + inputs: + artifactName: drop-ARM + itemPattern: '**/*.msix' + targetPath: $(Build.ArtifactStagingDirectory)\drop\ARM + + - task: DownloadPipelineArtifacts@2 + displayName: Download all .msix artifacts (ARM64) + condition: and(succeeded(), eq(variables.PackageARM64, 'true')) + inputs: + artifactName: drop-ARM64 + itemPattern: '**/*.msix' + targetPath: $(Build.ArtifactStagingDirectory)\drop\ARM64 - ${{ if eq(parameters.createStoreBrokerPackages, true) }}: - task: UniversalPackages@0 diff --git a/build/pipelines/templates/release-store.yaml b/build/pipelines/templates/release-store.yaml index c6193598..f8e3e245 100644 --- a/build/pipelines/templates/release-store.yaml +++ b/build/pipelines/templates/release-store.yaml @@ -13,10 +13,9 @@ jobs: steps: - checkout: none - - task: DownloadBuildArtifacts@0 + - download: current displayName: Download storeBrokerPayload artifact - inputs: - artifactName: storeBrokerPayload + artifact: storeBrokerPayload - task: MS-RDX-MRO.windows-store-publish-dev.flight-task.store-flight@2 displayName: Flight StoreBroker Payload to team ring diff --git a/build/pipelines/templates/release-vpack.yaml b/build/pipelines/templates/release-vpack.yaml index 2b2ad30f..32ff3332 100644 --- a/build/pipelines/templates/release-vpack.yaml +++ b/build/pipelines/templates/release-vpack.yaml @@ -16,10 +16,9 @@ jobs: steps: - checkout: none - - task: DownloadBuildArtifacts@0 + - download: current displayName: Download msixBundleSigned artifact - inputs: - artifactName: msixBundleSigned + artifact: msixBundleSigned - task: CopyFiles@2 displayName: Copy signed MsixBundle to vpack staging folder diff --git a/build/pipelines/templates/run-ui-tests.yaml b/build/pipelines/templates/run-ui-tests.yaml index 274e2a10..231eaef4 100644 --- a/build/pipelines/templates/run-ui-tests.yaml +++ b/build/pipelines/templates/run-ui-tests.yaml @@ -17,6 +17,8 @@ jobs: name: EssentialExperiences-Win11 variables: skipComponentGovernanceDetection: true + DropName: drop-${{ parameters.platform }} + steps: - checkout: self fetchDepth: 1 @@ -33,30 +35,29 @@ jobs: width: 1920 height: 1080 - - task: DownloadBuildArtifacts@0 + - download: current displayName: Download MsixBundle and CalculatorUITests - inputs: - artifactName: drop - itemPattern: | - drop/Release/${{ parameters.platform }}/Calculator/AppPackages/** - drop/Release/${{ parameters.platform }}/publish/** + artifact: $(DropName) + patterns: | + Calculator/AppPackages/** + publish/** - task: PowerShell@2 displayName: Install certificate inputs: - filePath: $(Pipeline.Workspace)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Add-AppDevPackage.ps1 - arguments: -CertificatePath $(Pipeline.Workspace)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Calculator_$(Build.BuildNumber)_${{ parameters.platform }}.cer -Force + filePath: $(Pipeline.Workspace)/$(DropName)/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Add-AppDevPackage.ps1 + arguments: -CertificatePath $(Pipeline.Workspace)/$(DropName)/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Calculator_$(Build.BuildNumber)_${{ parameters.platform }}.cer -Force - task: PowerShell@2 displayName: Install app inputs: - filePath: $(Pipeline.Workspace)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Add-AppDevPackage.ps1 + filePath: $(Pipeline.Workspace)/$(DropName)/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Add-AppDevPackage.ps1 arguments: -Force - task: VSTest@2 displayName: Run CalculatorUITests inputs: - testAssemblyVer2: $(Pipeline.Workspace)/drop/Release/${{ parameters.platform }}/publish/CalculatorUITests.dll - runSettingsFile: $(Pipeline.Workspace)/drop/Release/${{ parameters.platform }}/publish/${{ parameters.runsettingsFileName }} + testAssemblyVer2: $(Pipeline.Workspace)/$(DropName)/publish/CalculatorUITests.dll + runSettingsFile: $(Pipeline.Workspace)/$(DropName)/publish/${{ parameters.runsettingsFileName }} platform: ${{ parameters.platform }} configuration: Release diff --git a/build/pipelines/templates/run-unit-tests.yaml b/build/pipelines/templates/run-unit-tests.yaml index f76cfd7e..a6503f9c 100644 --- a/build/pipelines/templates/run-unit-tests.yaml +++ b/build/pipelines/templates/run-unit-tests.yaml @@ -11,22 +11,23 @@ jobs: condition: succeeded() variables: skipComponentGovernanceDetection: true + UnitTestsDir: $(Pipeline.Workspace)\drop-${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test steps: - checkout: none - download: current displayName: Download CalculatorUnitTests - artifact: drop - patterns: drop/Release/${{ parameters.platform }}/CalculatorUnitTests/AppPackages/CalculatorUnitTests_Test/** + artifact: drop-${{ parameters.platform }} + patterns: '**/CalculatorUnitTests_Test/**' - task: PowerShell@2 displayName: Install Certificate inputs: - filePath: $(Pipeline.Workspace)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\Add-AppDevPackage.ps1 - arguments: -CertificatePath $(Pipeline.Workspace)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\CalculatorUnitTests.cer -Force + filePath: $(UnitTestsDir)\Add-AppDevPackage.ps1 + arguments: -CertificatePath $(UnitTestsDir)\CalculatorUnitTests.cer -Force - task: VSTest@2 displayName: Run CalculatorUnitTests inputs: - testAssemblyVer2: $(Pipeline.Workspace)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\CalculatorUnitTests.msix + testAssemblyVer2: $(UnitTestsDir)\CalculatorUnitTests.msix otherConsoleOptions: /Platform:${{ parameters.platform }}