1
- parameters :
2
- - name : AutorestVersion
3
- displayName : ' Version of Autorest that trigger batch generation'
4
- type : string
5
- default : ' 4.x.x'
6
-
7
1
variables :
8
2
IntermediateStepTimeoutInMinutes : 30
9
3
GenerateTimeoutInMinutes : 120
@@ -23,6 +17,13 @@ variables:
23
17
24
18
trigger : none
25
19
20
+ resources :
21
+ pipelines :
22
+ - pipeline : pipelineA
23
+ project : release
24
+ source : pipelineA
25
+ trigger : true
26
+
26
27
stages :
27
28
- stage : Generate
28
29
jobs :
@@ -55,6 +56,19 @@ stages:
55
56
& $createBranchPath -Owner 'Azure' -Repo 'azure-powershell' -BaseBranch "$(GenerationBaseBranch)" -NewBranch $generationBranch -Token $token
56
57
Write-Host "##vso[task.setvariable variable=GenerationBranch;isOutput=true]$generationBranch"
57
58
59
+ - task : PowerShell@2
60
+ name : version
61
+ displayName : ' Get latest Autorest Version'
62
+ inputs :
63
+ targetType : inline
64
+ pwsh : true
65
+ script : |
66
+ $autorestPowershellUrl = "https://registry.npmjs.org/@autorest/powershell"
67
+ $response = Invoke-RestMethod -Uri $autorestPowershellUrl -Method Get
68
+ $latestAutorestVersion = $response.'dist-tags'.latest
69
+ Write-Host "Latest version of Autorest Powershell is $latestAutorestVersion"
70
+ Write-Host "##vso[task.setvariable variable=LatestAutorestVersion;isOutput=true]$latestAutorestVersion"
71
+
58
72
- task : PowerShell@2
59
73
name : mtrx
60
74
displayName : ' Generate Build Targets Matrix'
@@ -80,6 +94,7 @@ stages:
80
94
)
81
95
variables :
82
96
GenerationBranch : $[dependencies.prepare.outputs['checkout.GenerationBranch']]
97
+ LatestAutorestVersion : $[dependencies.prepare.outputs['version.LatestAutorestVersion']]
83
98
timeoutInMinutes : ${{ variables.GenerateTimeoutInMinutes }}
84
99
pool : ${{ variables.WindowsAgentPoolName }}
85
100
strategy :
@@ -107,7 +122,7 @@ stages:
107
122
git checkout "$(GenerationBranch)"
108
123
109
124
$batchGenerateModulesPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'batch-generate-modules.ps1'
110
- & $batchGenerateModulesPath -MatrixKey "$(MatrixKey)" -RepoRoot "$(Build.SourcesDirectory)" -AutorestVersion "${{ parameters.AutorestVersion }} "
125
+ & $batchGenerateModulesPath -MatrixKey "$(MatrixKey)" -RepoRoot "$(Build.SourcesDirectory)" -AutorestVersion "$(LatestAutorestVersion) "
111
126
workingDirectory : $(Build.SourcesDirectory)
112
127
113
128
- task : PublishPipelineArtifact@1
@@ -122,6 +137,7 @@ stages:
122
137
condition : always()
123
138
variables :
124
139
GenerationBranch : $[stageDependencies.Generate.prepare.outputs['checkout.GenerationBranch']]
140
+ LatestAutorestVersion : $[stageDependencies.Generate.prepare.outputs['version.LatestAutorestVersion']]
125
141
jobs :
126
142
- job : filter
127
143
displayName : ' Filter Changed Modules'
@@ -170,7 +186,7 @@ stages:
170
186
}
171
187
172
188
git add .
173
- git commit -m "Autorest Upgrade - ${{ parameters.AutorestVersion }} "
189
+ git commit -m "Autorest Upgrade - $(GenerationBranch) "
174
190
git push origin "$(GenerationBranch)"
175
191
176
192
- task : PowerShell@2
0 commit comments