11# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
22# contains an end to end validation pipeline using C# compilation tests for staging beta metadata
3+ name : $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
34trigger :
45 branches :
56 include :
@@ -19,13 +20,24 @@ resources:
1920 - repository : typespec-msgraph-reference
2021 type : git
2122 name : typespec-msgraph-reference
23+ - repository : 1ESPipelineTemplates
24+ type : git
25+ name : 1ESPipelineTemplates/1ESPipelineTemplates
26+ ref : refs/tags/release
2227variables :
2328 BuildConfiguration : ' Release'
2429 scriptsDirectory : ' $(Build.SourcesDirectory)\.azure-pipelines\scripts'
2530
2631extends :
2732 template : v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
2833 parameters :
34+ settings :
35+ networkIsolationPolicy : Permissive
36+ sdl :
37+ sourceRepositoriesToScan :
38+ exclude :
39+ - repository : typespec-msgraph
40+ - repository : typespec-msgraph-reference
2941 pool :
3042 name : Azure-Pipelines-1ESPT-ExDShared
3143 vmImage : windows-latest
@@ -62,18 +74,18 @@ extends:
6274 displayName : ' Restore dependencies'
6375 inputs :
6476 command : restore
65- projects : ' $(Build.SourcesDirectory)\typespec-msgraph-reference\typespec-msgraph-reference .sln'
77+ projects : ' $(Build.SourcesDirectory)\typespec-msgraph-reference.sln'
6678
6779 # Build the solution
6880 - task : DotNetCoreCLI@2
6981 displayName : ' Build solution'
7082 inputs :
7183 command : build
72- projects : ' $(Build.SourcesDirectory)\typespec-msgraph-reference\typespec-msgraph-reference .sln'
84+ projects : ' $(Build.SourcesDirectory)\typespec-msgraph-reference.sln'
7385 arguments : ' --configuration $(BuildConfiguration) --no-incremental'
7486 - task : CopyFiles@2
7587 inputs :
76- sourceFolder : ' $(Build.SourcesDirectory)/typespec-msgraph-reference/ bin/$(BuildConfiguration)/net10.0'
88+ sourceFolder : ' $(Build.SourcesDirectory)/bin/$(BuildConfiguration)/net10.0'
7789 contents : ' **/*'
7890 targetFolder : ' $(Build.ArtifactStagingDirectory)'
7991 displayName : Copy Typespec Reference executable
@@ -86,8 +98,8 @@ extends:
8698 inputs :
8799 - input : pipelineArtifact
88100 buildType : ' current'
89- artifactName : ' typespec-reference-tool'
90- targetPath : ' $(Build.SourcesDirectory)/typespec-reference-tool '
101+ artifactName : typespec-reference-tool
102+ targetPath : ' $(Build.ArtifactStagingDirectory)/typespecReferenceTool '
91103 outputs :
92104 - output : pipelineArtifact
93105 targetPath : ' $(Build.ArtifactStagingDirectory)/lib'
@@ -96,7 +108,13 @@ extends:
96108 - checkout : self # Add this to checkout msgraph-metadata repo
97109 displayName : checkout msgraph-metadata
98110 fetchDepth : 1
99- - pwsh : ' $(Build.SourcesDirectory)/.azure-pipelines/scripts/process-all-schemas.ps1 -ExecPath $(Build.SourcesDirectory)/typespec-reference-tool/typespec-msgraph-reference.exe'
111+ - task : CopyFiles@2
112+ inputs :
113+ sourceFolder : $(Build.ArtifactStagingDirectory)/typespecReferenceTool
114+ contents : ' **/*'
115+ targetFolder : ' $(Build.SourcesDirectory)/typespecReferenceTool'
116+ displayName : " Validate artifact and list contents"
117+ - pwsh : ' $(Build.SourcesDirectory)/.azure-pipelines/scripts/process-all-schemas.ps1 -ExePath $(Build.SourcesDirectory)/typespecReferenceTool/typespec-msgraph-reference.exe'
100118 displayName : " Process all the valid schemas files"
101119 - task : CopyFiles@2
102120 inputs :
@@ -113,8 +131,11 @@ extends:
113131 - input : pipelineArtifact
114132 buildType : ' current'
115133 artifactName : ' referenceLibrary'
116- targetPath : ' $(Build.SourcesDirectory )/tmp_lib'
134+ targetPath : ' $(Build.ArtifactStagingDirectory )/tmp_lib'
117135 steps :
136+ - checkout : self # Add this to checkout msgraph-metadata repo
137+ displayName : checkout msgraph-metadata
138+ fetchDepth : 1
118139 - checkout : typespec-msgraph
119140 displayName : checkout typespec-msgraph
120141 fetchDepth : 1
@@ -123,21 +144,30 @@ extends:
123144 git config --global user.email "GraphTooling@service.microsoft.com"
124145 git config --global user.name "Microsoft Graph DevX Tooling"
125146 displayName: 'Git: set user config'
126- # Copy files from the tmp folder to the checkout repo
127147 - task : CopyFiles@2
128148 inputs :
129- sourceFolder : ' $(Build.SourcesDirectory )/tmp_lib'
149+ sourceFolder : ' $(Build.ArtifactStagingDirectory )/tmp_lib'
130150 contents : ' **/*'
131- targetFolder : ' $(Build.SourcesDirectory)/typespec-msgraph/packages/typespec-reference-library /lib'
151+ targetFolder : ' $(Build.SourcesDirectory)/typespec-msgraph/packages/typespec-msgraph-reference /lib'
132152 overwrite : true
133153 displayName : Copy OpenAPI files to local typespec-msgraph repo
154+ - pwsh : |
155+ $manifestPath = "$(Build.SourcesDirectory)/typespec-msgraph/packages/typespec-msgraph-reference/lib/_manifest"
156+ if (Test-Path $manifestPath) {
157+ Write-Host "Deleting _manifest folder: $manifestPath" -ForegroundColor Yellow
158+ Remove-Item -Path $manifestPath -Recurse -Force
159+ Write-Host "_manifest folder deleted successfully" -ForegroundColor Green
160+ } else {
161+ Write-Host "_manifest folder not found, skipping deletion" -ForegroundColor Cyan
162+ }
163+ displayName: 'Delete _manifest folder'
134164 # Push changes to Typespec msgraph repo
135- - pwsh : ' $(scriptsDirectory) /git-push-reference-files.ps1'
165+ - pwsh : ' $(Build.SourcesDirectory)/msgraph-metadata/.azure-pipelines/scripts /git-push-reference-files.ps1'
136166 displayName : Publish new generated files to msgraph-metadata repo
137167 env :
138168 PublishChanges : True
139- workingDirectory : ' $(Build.SourcesDirectory)/typespec-msgraph'
140169 enabled : true
170+ workingDirectory : ' $(Build.SourcesDirectory)/typespec-msgraph'
141171
142172 # Create PR
143173 - task : AzureKeyVault@2
@@ -147,7 +177,7 @@ extends:
147177 KeyVaultName : akv-prod-eastus
148178 SecretsFilter : " microsoft-graph-devx-bot-appid,microsoft-graph-devx-bot-privatekey"
149179
150- - pwsh : ' $(scriptsDirectory) /create-pull-request.ps1'
180+ - pwsh : ' $(Build.SourcesDirectory)/msgraph-metadata/.azure-pipelines/scripts /create-pull-request.ps1'
151181 displayName : ' Create Pull Request for the generated OpenAPI files for msgraph-metadata'
152182 env :
153183 BaseBranch : main
@@ -156,9 +186,5 @@ extends:
156186 GhAppKey : $(microsoft-graph-devx-bot-privatekey)
157187 OverrideSkipCI : false
158188 RepoName : ' microsoftgraph/typespec-msgraph'
159- ScriptsDirectory : $(scriptsDirectory)
160- # Version is intentionally left empty for OpenAPI PRs as versioning is not applicable in this context.
161- Version : ' '
189+ scriptDir : $(Build.SourcesDirectory)\msgraph-metadata\.azure-pipelines\scripts
162190 workingDirectory : ' $(Build.SourcesDirectory)/typespec-msgraph'
163-
164-
0 commit comments