Skip to content

Commit

Permalink
ci skip
Browse files Browse the repository at this point in the history
  • Loading branch information
smitpatel committed Jun 20, 2023
1 parent e9e69f7 commit ea2f2cf
Showing 1 changed file with 145 additions and 0 deletions.
145 changes: 145 additions & 0 deletions eng/pipelines/official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,148 @@ stages:
dependsOn: Validate
jobs:
- template: templates/build-official-release.yml

- stage: Publish
displayName: Publish
dependsOn: Build
variables:
# https://devdiv.visualstudio.com/DevDiv/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=434&path=DotNet-Project-System
# Variables used:
# - SymbolsUncPath
- group: DotNet-Project-System
jobs:
- template: templates/publish-assets-and-packages.yml
- template: templates/publish-symbols.yml
# Disabling RichNav due to an acquisition issue. See: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1659507
# - template: templates/publish-richnav.yml

# Skip this stage only when specifically requested (via SkipCompliance).
- ${{ if eq(parameters.SkipCompliance, false) }}:
- stage: Compliance
displayName: Compliance
dependsOn: Build
variables:
- name: UploadTSAResults
value: ${{ parameters.UploadTSAResults }}

# Gets the VisualStudioMinimumVersion variable produced by the Build pipeline.
# This value is used in the analyze-api.yml template.
- name: VisualStudioMinimumVersion
value: $[ stageDependencies.Build.BuildOfficialRelease.outputs['SetVisualStudioMinimumVersionVariable.VisualStudioMinimumVersion'] ]
# https://devdiv.visualstudio.com/DevDiv/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=434&path=DotNet-Project-System
# Variables used:
# - ApiScanConnectionString
- group: DotNet-Project-System
jobs:
- template: templates/analyze-compliance.yml
- template: templates/analyze-api.yml

- stage: Localization
displayName: Localization
# [] clears the dependency on the previous stages allowing parallelism.
dependsOn: []
variables:
# Variable group containing the PATs required for running OneLocBuild.
# See: https://devdiv.visualstudio.com/DevDiv/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=343&path=OneLocBuildVariables
# Variables used:
# - BotAccount-dotnet-bot-repo-PAT
# - dn-bot-ceapex-package-r
- group: OneLocBuildVariables
jobs:
- template: templates/generate-localization.yml

# Run this stage only when specifically requested (via CreateOptimizationData) or when the pipeline was ran on a schedule.
- ${{ if or(eq(parameters.CreateOptimizationData, true), eq(variables['Build.Reason'], 'Schedule')) }}:
# This template is provided by the DartLabOptProfTemplates repo, declared in the repositories section (top of this file).
# It is a stage template, defining our entire Optimization stage.
- template: \templates\stages\visual-studio\single-runsettings.yml@DartLabOptProfTemplates
parameters:
name: Optimization
displayName: Optimization
dependsOn:
- Publish
# Only include the Compliance stage when it is not skipped.
- ${{ if eq(parameters.SkipCompliance, false) }}:
- Compliance
variables:
- name: visualStudioBootstrapperURI
# If you set this value to the visualStudioBootstrapperURI parameter directly, it does not resolve correctly. Instead, we set it to a variable and pass that variable into the parameter.
# For parameter, variable, and expression syntax/usage, see:
# - https://docs.microsoft.com/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#understand-variable-syntax
# - https://docs.microsoft.com/azure/devops/pipelines/process/expressions?view=azure-devops
# - https://docs.microsoft.com/azure/devops/pipelines/process/runtime-parameters?view=azure-devops&tabs=script#how-can-i-use-variables-inside-of-templates
# For variables across stages, see:
# - https://docs.microsoft.com/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#use-outputs-in-a-different-stage
# - https://arunksingh16.medium.com/azure-devops-share-variable-across-stages-9bca85abfe8a
# - https://stackoverflow.com/a/57488169/294804
# - https://github.com/microsoft/azure-pipelines-tasks/issues/4743
value: $[ stageDependencies.Publish.PublishAssetsAndPackages.outputs['UpdateRunSettings.visualStudioBootstrapperURI'] ]
runSettingsURI: https://vsdrop.corp.microsoft.com/file/v1/RunSettings/$(System.TeamProject)/dotnet/project-system/$(Build.SourceBranchName)/$(Build.BuildId);OptProf.runsettings
# This variable is set during the 'Update RunSettings' (UpdateRunSettings.ps1) step in the publish-assets-and-packages.yml.
# This variable is expanded when it is used: https://docs.microsoft.com/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#macro-syntax-variables
visualStudioBootstrapperURI: $(visualStudioBootstrapperURI)
# The output of the optimization process. The first half of the path is provided to the DropNamePrefix input in the 'Install OptProf Plugin' (MicroBuildOptProfPlugin) step in build-official-release.yml.
optOptimizationInputsDropName: OptimizationInputs/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceVersion)/$(Build.BuildId)/$(System.StageAttempt)
testLabPoolName: VS-Platform
previousOptimizationInputsDropName: $(previousOptimizationInputsDropName)
prePublishOptimizationInputsDropStepList:
# This extracts the Metadata.json file information from the OptProf artifact in the build and sets the drop name to the previousOptimizationInputsDropName variable.
# The previousOptimizationInputsDropName variable enables LKG (Last Known Good) support.
# See LKG support for details: https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/29053/Enabling-LKG-support
# This PowerShell script needs to be written in this YAML file directly as the job that runs this task does not have access to files on-disk (it does not perform a checkout).
- powershell: |
$artifactParameters = @{
InstanceURL = 'https://dev.azure.com/devdiv'
ProjectName = 'DevDiv'
BuildID = '$(Build.BuildId)'
ArtifactName = 'OptProf'
OAuthAccessToken = (ConvertTo-SecureString '$(System.AccessToken)' -AsPlainText -Force)
}
$artifact = Get-BuildArtifact @artifactParameters
$containerName = $artifact.Resource.Data -Split '/' | Select-Object -Last 1
$metadataString = Read-BuildArtifactFile @artifactParameters -FileName (Join-Path $containerName 'Metadata.json')
$dropName = ($metadataString | ConvertFrom-Json).OptimizationData
Write-Host "previousOptimizationInputsDropName: $dropName"
Set-AzurePipelinesVariable 'previousOptimizationInputsDropName' $dropName
displayName: Set previousOptimizationInputsDropName variable
# Run this stage only when specifically requested (via CreateVSInsertion or CreateVSGreenInsertion) or when the pipeline was ran on a schedule.
# Conditional insertion syntax:
# - https://docs.microsoft.com/azure/devops/pipelines/process/expressions?view=azure-devops#conditional-insertion
# - https://www.andrewhoefling.com/Blog/Post/conditional-insertion-in-azure-pipelines-yaml
- ${{ if or(eq(parameters.CreateVSInsertion, true), eq(parameters.CreateVSGreenInsertion, true), eq(variables['Build.Reason'], 'Schedule')) }}:
- stage: Insertion
displayName: Insertion
dependsOn:
# The Build dependsOn is required for putting that stage's variables into the stageDependencies property bag (for PackageVersion).
- Build
- Publish
# Only include the Compliance stage when it is not skipped.
- ${{ if eq(parameters.SkipCompliance, false) }}:
- Compliance
variables:
# Gets the PackageVersion variable produced by the Build pipeline.
PackageVersion: $[ stageDependencies.Build.BuildOfficialRelease.outputs['SetPackageVersion.PackageVersion'] ]
# Gets the AssemblyVersion variable produced by the Build pipeline.
AssemblyVersion: $[ stageDependencies.Build.BuildOfficialRelease.outputs['SetAssemblyVersion.AssemblyVersion'] ]
InsertionVSBranch: ${{ parameters.InsertionVSBranch }}
# Hard-coded assumption that the commit referenced by the previous VS insertion is within the last 100 commits in the $(InsertionVSBranch) of the VS repo.
PriorInsertionCommitDepth: 100
jobs:
- ${{ if or(eq(parameters.CreateVSInsertion, true), eq(variables['Build.Reason'], 'Schedule')) }}:
- template: templates/generate-vs-insertion.yml

- ${{ if or(eq(parameters.CreateVSGreenInsertion, true), eq(variables['Build.Reason'], 'Schedule')) }}:
- template: azure-pipelines/external/component-insertion.yml@VSCodeExtensionRepo
parameters:
VariableInitSteps:
- powershell: '$(Build.SourcesDirectory)/eng/scripts/InsertReviewers.ps1'
sourceBranch: $(Build.SourceBranch)
sourceCommit: $(Build.SourceVersion)
runName: $(Build.BuildNumber)
runID: $(Build.BuildId)
pipelineID: $(System.DefinitionId)
InsertTargetBranch: ${{ parameters.InsertionVSGreenBranch }}
ComponentSubDir: $(Build.Repository.Name)

0 comments on commit ea2f2cf

Please sign in to comment.