From b0e9e0ab5622c3b42177cb7c97e381619f228524 Mon Sep 17 00:00:00 2001 From: Quentin Al-Timimi <27322516+quentin987@users.noreply.github.com> Date: Thu, 26 Aug 2021 08:47:10 -0700 Subject: [PATCH] Restructure pipeline to move release steps out of Package ES (#1659) * Pipeline update * moving download internals up in order * updated internal download step and removed duplicate isPublicRelease parameter --- .../azure-pipelines.ci-internal.yaml | 14 +- build/pipelines/azure-pipelines.ci.yaml | 8 +- build/pipelines/azure-pipelines.release.yaml | 16 +- .../templates/build-app-internal.yaml | 86 ---------- .../pipelines/templates/build-app-public.yaml | 21 --- .../templates/build-single-architecture.yaml | 90 ++++++++++- .../templates/package-appxbundle.yaml | 67 +++++++- .../prepare-release-internalonly.yaml | 151 ------------------ build/pipelines/templates/release-store.yaml | 89 +++++++++++ build/pipelines/templates/release-vpack.yaml | 42 +++++ 10 files changed, 305 insertions(+), 279 deletions(-) delete mode 100644 build/pipelines/templates/build-app-internal.yaml delete mode 100644 build/pipelines/templates/build-app-public.yaml delete mode 100644 build/pipelines/templates/prepare-release-internalonly.yaml create mode 100644 build/pipelines/templates/release-store.yaml create mode 100644 build/pipelines/templates/release-vpack.yaml diff --git a/build/pipelines/azure-pipelines.ci-internal.yaml b/build/pipelines/azure-pipelines.ci-internal.yaml index b4e857c..6683470 100644 --- a/build/pipelines/azure-pipelines.ci-internal.yaml +++ b/build/pipelines/azure-pipelines.ci-internal.yaml @@ -13,16 +13,22 @@ pr: none name: 0.$(Date:yyMM).$(DayOfMonth)$(Rev:rr).0 jobs: -- template: ./templates/build-app-internal.yaml +- template: ./templates/build-single-architecture.yaml parameters: + isReleaseBuild: true + useTestVersionOfInternalsPackage: true platform: x64 -- template: ./templates/build-app-internal.yaml +- template: ./templates/build-single-architecture.yaml parameters: + isReleaseBuild: true + useTestVersionOfInternalsPackage: true platform: x86 -- template: ./templates/build-app-internal.yaml +- template: ./templates/build-single-architecture.yaml parameters: + isReleaseBuild: true + useTestVersionOfInternalsPackage: true platform: ARM - template: ./templates/run-ui-tests.yaml @@ -44,3 +50,5 @@ jobs: platform: x86 - template: ./templates/package-appxbundle.yaml + parameters: + useTestVersionOfInternalsPackage: true diff --git a/build/pipelines/azure-pipelines.ci.yaml b/build/pipelines/azure-pipelines.ci.yaml index b04b2d2..f21dd59 100644 --- a/build/pipelines/azure-pipelines.ci.yaml +++ b/build/pipelines/azure-pipelines.ci.yaml @@ -16,21 +16,21 @@ pr: name: 0.$(Date:yyMM).$(DayOfMonth)$(Rev:rr).0 jobs: -- template: ./templates/build-app-public.yaml +- template: ./templates/build-single-architecture.yaml parameters: platform: x64 -- template: ./templates/build-app-public.yaml +- template: ./templates/build-single-architecture.yaml parameters: platform: x86 condition: not(eq(variables['Build.Reason'], 'PullRequest')) -- template: ./templates/build-app-public.yaml +- template: ./templates/build-single-architecture.yaml parameters: platform: ARM condition: not(eq(variables['Build.Reason'], 'PullRequest')) -- template: ./templates/build-app-public.yaml +- template: ./templates/build-single-architecture.yaml parameters: platform: ARM64 condition: not(eq(variables['Build.Reason'], 'PullRequest')) diff --git a/build/pipelines/azure-pipelines.release.yaml b/build/pipelines/azure-pipelines.release.yaml index 05eec0b..1c4725c 100644 --- a/build/pipelines/azure-pipelines.release.yaml +++ b/build/pipelines/azure-pipelines.release.yaml @@ -16,21 +16,21 @@ variables: name: '$(versionMajor).$(versionMinor).$(versionBuild).$(versionPatch)' jobs: -- template: ./templates/build-app-internal.yaml +- template: ./templates/build-single-architecture.yaml parameters: platform: x64 - isPublicRelease: true + isReleaseBuild: true -- template: ./templates/build-app-internal.yaml +- template: ./templates/build-single-architecture.yaml parameters: platform: x86 - isPublicRelease: true + isReleaseBuild: true condition: not(eq(variables['Build.Reason'], 'PullRequest')) -- template: ./templates/build-app-internal.yaml +- template: ./templates/build-single-architecture.yaml parameters: platform: ARM - isPublicRelease: true + isReleaseBuild: true condition: not(eq(variables['Build.Reason'], 'PullRequest')) - template: ./templates/run-unit-tests.yaml @@ -44,5 +44,7 @@ jobs: - template: ./templates/package-appxbundle.yaml parameters: signBundle: true + createStoreBrokerPackages: true -- template: ./templates/prepare-release-internalonly.yaml +- template: ./templates/release-store.yaml +- template: ./templates/release-vpack.yaml \ No newline at end of file diff --git a/build/pipelines/templates/build-app-internal.yaml b/build/pipelines/templates/build-app-internal.yaml deleted file mode 100644 index f09e2cd..0000000 --- a/build/pipelines/templates/build-app-internal.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# This template contains a job to build the app for a single architecture and run static analysis -# tools on the binaries. -# The app is built in a production configuration to be released to the Store and the Windows image. -# This job relies on Microsoft-internal resources to run. - -parameters: - platform: '' - condition: '' - isPublicRelease: false - -jobs: -- job: Build${{ parameters.platform }} - displayName: Build ${{ parameters.platform }} - condition: ${{ parameters.condition }} - pool: - vmImage: windows-2019 - variables: - BuildConfiguration: Release - BuildPlatform: ${{ parameters.platform }} - steps: - - checkout: self - fetchDepth: 1 - - - task: UniversalPackages@0 - displayName: Download internals package - inputs: - command: download - downloadDirectory: $(Build.SourcesDirectory) - vstsFeed: WindowsInboxApps - vstsFeedPackage: calculator-internals - ${{ if eq(parameters.isPublicRelease, true) }}: - vstsPackageVersion: 0.0.66 - ${{ if eq(parameters.isPublicRelease, false) }}: - vstsPackageVersion: 0.0.65 - - - template: ./build-single-architecture.yaml - parameters: - extraMsBuildArgs: '/p:IsStoreBuild=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: - sourceScanPath: $(Agent.BuildDirectory) diff --git a/build/pipelines/templates/build-app-public.yaml b/build/pipelines/templates/build-app-public.yaml deleted file mode 100644 index 70f18e5..0000000 --- a/build/pipelines/templates/build-app-public.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# This template contains a job to build the app for a single architecture. -# Only the contents of the public repository are built; internal resources are not used. - -parameters: - platform: '' - condition: '' - -jobs: -- job: Build${{ parameters.platform }} - displayName: Build ${{ parameters.platform }} - condition: ${{ parameters.condition }} - pool: - vmImage: windows-2019 - variables: - BuildConfiguration: Release - BuildPlatform: ${{ parameters.platform }} - steps: - - checkout: self - fetchDepth: 1 - - - template: ./build-single-architecture.yaml \ No newline at end of file diff --git a/build/pipelines/templates/build-single-architecture.yaml b/build/pipelines/templates/build-single-architecture.yaml index eb9bf80..fb3e60f 100644 --- a/build/pipelines/templates/build-single-architecture.yaml +++ b/build/pipelines/templates/build-single-architecture.yaml @@ -1,10 +1,41 @@ -# This template contains steps to build the app for a single architecture. -# The job containing these steps must set the variables 'BuildConfiguration' and 'BuildPlatform'. +# This template contains a job to build the app for a single architecture. parameters: - extraMsBuildArgs: '' + isReleaseBuild: false + useTestVersionOfInternalsPackage: false + 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) }}: + ExtraMSBuildArgs: '/p:IsStoreBuild=true' + ${{ if eq(parameters.isReleaseBuild, false) }}: + ExtraMSBuildArgs: '' + 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 + ${{ if eq(parameters.useTestVersionOfInternalsPackage, false) }}: + vstsPackageVersion: 0.0.66 + ${{ if eq(parameters.useTestVersionOfInternalsPackage, true) }}: + vstsPackageVersion: 0.0.65 -steps: - task: NuGetToolInstaller@1 displayName: Use NuGet 5.x inputs: @@ -29,7 +60,7 @@ steps: inputs: solution: src/Calculator.sln vsVersion: 16.0 - 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\ ${{ parameters.extraMsBuildArgs }} + 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) platform: $(BuildPlatform) configuration: $(BuildConfiguration) maximumCpuCount: true @@ -40,3 +71,52 @@ steps: artifactName: drop pathToPublish: $(Build.BinariesDirectory) parallel: true + + - ${{ 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: + sourceScanPath: $(Agent.BuildDirectory) \ No newline at end of file diff --git a/build/pipelines/templates/package-appxbundle.yaml b/build/pipelines/templates/package-appxbundle.yaml index f8de83c..277c94a 100644 --- a/build/pipelines/templates/package-appxbundle.yaml +++ b/build/pipelines/templates/package-appxbundle.yaml @@ -1,8 +1,10 @@ # This template contains a job which takes .appx packages which were built separately for each -# architecture (arm, x86, etc.) and combines them into a single .appxbundle. +# architecture (arm, x86, etc.) and combines them into a single .appxbundle. In release builds, +# this job also signs the bundle and creates StoreBroker packages. parameters: signBundle: false + useTestVersionOfInternalsPackage: false jobs: - job: Package @@ -21,6 +23,8 @@ jobs: vmImage: windows-2019 variables: skipComponentGovernanceDetection: true + StoreBrokerMediaRootPath: $(TEMP)\SBMedia + StoreBrokerPackagePath: $(Build.ArtifactStagingDirectory)\storeBrokerPayload steps: - checkout: self fetchDepth: 1 @@ -31,6 +35,26 @@ jobs: artifactName: drop itemPattern: '**/*.appx' + - ${{ if eq(parameters.createStoreBrokerPackages, true) }}: + - task: UniversalPackages@0 + displayName: Download internals package + inputs: + command: download + downloadDirectory: $(Build.SourcesDirectory) + vstsFeed: WindowsInboxApps + vstsFeedPackage: calculator-internals + vstsPackageVersion: 0.0.66 + + - ${{ if eq(parameters.useTestVersionOfInternalsPackage, true) }}: + - task: UniversalPackages@0 + displayName: Download internals package + inputs: + command: download + downloadDirectory: $(Build.SourcesDirectory) + vstsFeed: WindowsInboxApps + vstsFeedPackage: calculator-internals + vstsPackageVersion: 0.0.65 + - task: PowerShell@2 displayName: Generate AppxBundle mapping inputs: @@ -98,4 +122,43 @@ jobs: displayName: Publish AppxBundleSigned artifact inputs: pathtoPublish: $(Build.ArtifactStagingDirectory)\appxBundle - artifactName: appxBundleSigned \ No newline at end of file + artifactName: appxBundleSigned + + - ${{ if eq(parameters.createStoreBrokerPackages, true) }}: + - powershell: | + # Just modify this line to indicate where your en-us PDP file is. Leave the other lines alone. + $enUSPdpFilePath = "$(Build.SourcesDirectory)\PDP\en-US\PDP.xml" + + # This is going to save the release value from the PDP file to $(SBMediaReleaseVersion) + # which you can then refer to in the UniversalPackages task. + $release = ([xml](Get-Content $enUSPdpFilePath)).ProductDescription.Release.Trim() + Write-Host "##vso[task.setvariable variable=SBMediaReleaseVersion;]$release" + displayName: Determine the PDP Media release version from the en-us PDP file + + - task: UniversalPackages@0 + displayName: Download PDP media (screenshots, trailers) universal package + inputs: + command: download + downloadDirectory: $(StoreBrokerMediaRootPath)/$(SBMediaReleaseVersion) + vstsFeed: WindowsInboxApps + vstsFeedPackage: calculator-pdp-media + vstsPackageVersion: $(SBMediaReleaseVersion) + + - task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@2 + displayName: Create StoreBroker Payload + inputs: + serviceEndpoint: Calculator StoreBroker Connection + sbConfigPath: Tools/Build/StoreBroker/SBCalculatorConfig.json + sourceFolder: $(Build.ArtifactStagingDirectory)/appxBundle + contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle + pdpPath: $(Build.SourcesDirectory)\PDP + pdpInclude: PDP.xml + pdpMediaPath: $(StoreBrokerMediaRootPath) + outSBPackagePath: $(StoreBrokerPackagePath) + outSBName: SBCalculator + + - task: PublishBuildArtifacts@1 + displayName: Publish StoreBroker Payload artifact + inputs: + pathtoPublish: $(StoreBrokerPackagePath) + artifactName: storeBrokerPayload \ No newline at end of file diff --git a/build/pipelines/templates/prepare-release-internalonly.yaml b/build/pipelines/templates/prepare-release-internalonly.yaml deleted file mode 100644 index 4cbf424..0000000 --- a/build/pipelines/templates/prepare-release-internalonly.yaml +++ /dev/null @@ -1,151 +0,0 @@ -# This template contains a job which builds artifacts needed to release the app to the store and to -# Windows using Microsoft-internal systems. It relies on Microsoft-internal resources and will not -# work outside of Microsoft. -# Specifically, this job: -# - Builds VPacks for including the app in the Windows OS build. Azure DevOps Universal Packages -# offers similar capabilities. -# - Creates StoreBroker packages containing Microsoft Store assets. Although the Store assets for -# this app are not open source, the StoreBroker tool is available at -# https://github.com/Microsoft/StoreBroker. - -jobs: -- job: WindowsInternalRelease - dependsOn: Package - pool: - name: Package ES Standard Build - workspace: - clean: outputs - variables: - skipComponentGovernanceDetection: true - SBMediaRootPath: '$(TEMP)\SBMedia' - SBPackagePath: '$(Build.ArtifactStagingDirectory)\storeBrokerPayload' - SBLogPath: '$(SBPackagePath)\StoreBroker.log' - FlightId: '161f0975-cb5f-475b-8ef6-26383c37621f' - AppId: '9WZDNCRFHVN5' - ProductId: '00009007199266248474' - steps: - - checkout: self - clean: true - - # This must be the first task in the job definition, since it modifies the build environment - # in ways other tasks would not expect (for example, it clears the artifacts directory). - - task: PkgESSetupBuild@10 - displayName: Initialize Package ES - inputs: - productName: Calculator - disableWorkspace: true - useDfs: false - env: - XES_DISABLEPROV: true - - - task: NuGetToolInstaller@1 - displayName: Use NuGet 5.x - inputs: - versionSpec: 5.x - - - task: DownloadBuildArtifacts@0 - displayName: Download appxBundleSigned artifact - inputs: - artifactName: appxBundleSigned - - - task: CopyFiles@2 - displayName: Copy signed AppxBundle to vpack staging folder - inputs: - sourceFolder: $(Build.ArtifactStagingDirectory)\appxBundleSigned - contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle - targetFolder: $(Build.ArtifactStagingDirectory)\vpack\appxBundle - - - task: PkgESVPack@10 - displayName: Create and push vpack for app - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - inputs: - sourceDirectory: $(Build.ArtifactStagingDirectory)\vpack\appxBundle - description: VPack for the Calculator Application - pushPkgName: calculator.app - version: $(versionMajor).$(versionMinor).$(versionBuild) - owner: paxeeapps - provData: true - - - - task: PublishBuildArtifacts@1 - displayName: Publish vpack\app artifact with vpack manifest - inputs: - pathtoPublish: $(XES_VPACKMANIFESTDIRECTORY)\$(XES_VPACKMANIFESTNAME) - artifactName: vpack\app - - - task: UniversalPackages@0 - displayName: Download internals package - inputs: - command: download - downloadDirectory: $(Build.SourcesDirectory) - vstsFeed: WindowsInboxApps - vstsFeedPackage: calculator-internals - vstsPackageVersion: 0.0.66 - - - powershell: | - # Just modify this line to indicate where your en-us PDP file is. Leave the other lines alone. - $enUSPdpFilePath = "$(Build.SourcesDirectory)\PDP\en-US\PDP.xml" - - # This is going to save the release value from the PDP file to $(SBMediaReleaseVersion) - # which you can then refer to in the UniversalPackages task. - $release = ([xml](Get-Content $enUSPdpFilePath)).ProductDescription.Release.Trim() - Write-Host "##vso[task.setvariable variable=SBMediaReleaseVersion;]$release" - displayName: Determine the PDP Media release version from the en-us PDP file - - - task: UniversalPackages@0 - displayName: Download PDP media (screenshots, trailers) universal package - inputs: - command: download - downloadDirectory: $(SBMediaRootPath)/$(SBMediaReleaseVersion) - vstsFeed: WindowsInboxApps - vstsFeedPackage: calculator-pdp-media - vstsPackageVersion: $(SBMediaReleaseVersion) - - - task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@2 - displayName: Create StoreBroker Payload - inputs: - serviceEndpoint: Calculator StoreBroker Connection - sbConfigPath: Tools/Build/StoreBroker/SBCalculatorConfig.json - sourceFolder: $(Build.ArtifactStagingDirectory)/appxBundleSigned - contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle - pdpPath: '$(Build.SourcesDirectory)\PDP' - pdpInclude: PDP.xml - pdpMediaPath: '$(SBMediaRootPath)' - outSBPackagePath: '$(SBPackagePath)' - outSBName: SBCalculator - - - task: PublishBuildArtifacts@1 - displayName: Publish StoreBroker Payload artifact - inputs: - pathtoPublish: '$(SBPackagePath)' - artifactName: storeBrokerPayload - - - task: MS-RDX-MRO.windows-store-publish-dev.flight-task.store-flight@2 - displayName: 'Flight StoreBroker Payload to team ring' - name: StoreBrokerFlight - inputs: - serviceEndpoint: Calculator StoreBroker Connection - appId: '$(AppId)' - flightId: '$(FlightId)' - inputMethod: JsonAndZip - jsonPath: '$(SBPackagePath)\SBCalculator.json' - zipPath: '$(SBPackagePath)\SBCalculator.zip' - force: true - skipPolling: true - targetPublishMode: Immediate - logPath: '$(SBLogPath)' - deletePackages: true - numberOfPackagesToKeep: 0 - - - task: PkgESStoreBrokerAeroUpload@10 - displayName: Upload to Aero flighting dashboard - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - inputs: - ProductId: '$(ProductId)' - FlightId: '$(FlightId)' - SubmissionId: '$(StoreBrokerFlight.WS_SubmissionId)' - SubmissionDataPath: '$(SBPackagePath)\SBCalculator.json' - PackagePath: '$(SBPackagePath)\SBCalculator.zip' - AeroEnvironment: Production diff --git a/build/pipelines/templates/release-store.yaml b/build/pipelines/templates/release-store.yaml new file mode 100644 index 0000000..8a85ebb --- /dev/null +++ b/build/pipelines/templates/release-store.yaml @@ -0,0 +1,89 @@ +# This template contains jobs to release the app to the Store. + +jobs: +- job: ReleaseStore + dependsOn: Package + pool: + vmImage: windows-2019 + variables: + skipComponentGovernanceDetection: true + StoreBrokerPackagePath: $(Build.ArtifactStagingDirectory)\storeBrokerPayload + StoreBrokerLogPath: $(StoreBrokerPackagePath)\StoreBroker.log + FlightId: 161f0975-cb5f-475b-8ef6-26383c37621f + AppId: 9WZDNCRFHVN5 + ProductId: 00009007199266248474 + steps: + - checkout: none + + - task: DownloadBuildArtifacts@0 + displayName: Download storeBrokerPayload artifact + inputs: + artifactName: storeBrokerPayload + + - task: MS-RDX-MRO.windows-store-publish-dev.flight-task.store-flight@2 + displayName: Flight StoreBroker Payload to team ring + name: StoreBrokerFlight + inputs: + serviceEndpoint: Calculator StoreBroker Connection + appId: $(AppId) + flightId: $(FlightId) + inputMethod: JsonAndZip + jsonPath: $(StoreBrokerPackagePath)\SBCalculator.json + zipPath: $(StoreBrokerPackagePath)\SBCalculator.zip + force: true + skipPolling: true + targetPublishMode: Immediate + logPath: $(StoreBrokerLogPath) + deletePackages: true + numberOfPackagesToKeep: 0 + +# TODO when Aero makes a new task available which does not depend on on-prem Package ES, remove this job +# and add the Aero upload task to the "ReleaseStore" job. +- job: ReleaseAero + dependsOn: ReleaseStore + pool: + name: Package ES Standard Build + workspace: + clean: outputs + variables: + skipComponentGovernanceDetection: true + StoreBrokerPackagePath: $(Build.ArtifactStagingDirectory)\storeBrokerPayload + FlightId: 161f0975-cb5f-475b-8ef6-26383c37621f + AppId: 9WZDNCRFHVN5 + ProductId: 00009007199266248474 + SubmissionId: $[ dependencies.ReleaseStore.outputs['StoreBrokerFlight.WS_SubmissionId'] ] + steps: + - checkout: none + + # This must be the first task in the job definition, since it modifies the build environment + # in ways other tasks would not expect (for example, it clears the artifacts directory). + - task: PkgESSetupBuild@10 + displayName: Initialize Package ES + inputs: + productName: Calculator + disableWorkspace: true + useDfs: false + env: + XES_DISABLEPROV: true + + - task: NuGetToolInstaller@1 + displayName: Use NuGet 5.x + inputs: + versionSpec: 5.x + + - task: DownloadBuildArtifacts@0 + displayName: Download storeBrokerPayload artifact + inputs: + artifactName: storeBrokerPayload + + - task: PkgESStoreBrokerAeroUpload@10 + displayName: Upload to Aero flighting dashboard + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + ProductId: '$(ProductId)' + FlightId: '$(FlightId)' + SubmissionId: '$(SubmissionId)' + SubmissionDataPath: '$(StoreBrokerPackagePath)\SBCalculator.json' + PackagePath: '$(StoreBrokerPackagePath)\SBCalculator.zip' + AeroEnvironment: Production diff --git a/build/pipelines/templates/release-vpack.yaml b/build/pipelines/templates/release-vpack.yaml new file mode 100644 index 0000000..aac7fbb --- /dev/null +++ b/build/pipelines/templates/release-vpack.yaml @@ -0,0 +1,42 @@ +# This template contains a job to create a VPack. The VPack is used to preinstall the app in a +# Windows OS build. + +jobs: +- job: ReleaseVPack + dependsOn: Package + pool: + vmImage: windows-2019 + variables: + skipComponentGovernanceDetection: true + steps: + - checkout: none + + - task: DownloadBuildArtifacts@0 + displayName: Download appxBundleSigned artifact + inputs: + artifactName: appxBundleSigned + + - task: CopyFiles@2 + displayName: Copy signed AppxBundle to vpack staging folder + inputs: + sourceFolder: $(Build.ArtifactStagingDirectory)\appxBundleSigned + contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle + targetFolder: $(Build.ArtifactStagingDirectory)\vpack\appxBundle + + - task: PkgESVPack@12 + displayName: Create and push vpack for app + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + sourceDirectory: $(Build.ArtifactStagingDirectory)\vpack\appxBundle + description: VPack for the Calculator Application + pushPkgName: calculator.app + version: $(versionMajor).$(versionMinor).$(versionBuild) + owner: paxeeapps + provData: true + + - task: PublishBuildArtifacts@1 + displayName: Publish vpack\app artifact with vpack manifest + inputs: + pathtoPublish: $(XES_VPACKMANIFESTDIRECTORY)\$(XES_VPACKMANIFESTNAME) + artifactName: vpackManifest