@@ -7,8 +7,6 @@ schedules:
7
7
include :
8
8
- main
9
9
10
- name : $(Build.SourceBranchName)_$(Build.Reason)
11
-
12
10
trigger : none
13
11
14
12
# This pipeline is triggered by the completion of scheduled builds
@@ -50,12 +48,12 @@ resources:
50
48
variables :
51
49
- template : /ci/variables/cfs.yml@eng
52
50
53
-
54
51
extends :
55
52
template : v1/1ES.Official.PipelineTemplate.yml@1es
56
53
parameters :
57
54
featureFlags :
58
55
incrementalSDLBinaryAnalysis : true
56
+ incrementalSDLSourceAnalysis : true
59
57
pool :
60
58
name : 1es-pool-azfunc
61
59
image : 1es-windows-2022
@@ -70,46 +68,21 @@ extends:
70
68
- stage : ConsolidateArticacts
71
69
displayName : " Assemble Artifacts"
72
70
jobs :
73
- - job : AssembleArtifacts
74
- timeoutInMinutes : 200 # Have this here in case there are new artifacts to be scanned with increment SDL binary analysis
75
- displayName : " Assemble Artifacts"
71
+ - job : ProcessNuGetPackage
72
+ displayName : " Process NuGet Package"
76
73
templateContext :
77
- outputParentDirectory : $(Build.ArtifactStagingDirectory)
78
74
outputs :
79
- - output : pipelineArtifact
80
- displayName : Publish assembled artifacts
81
- path : $(Pipeline.Workspace)\staging
82
- artifact : drop
83
-
75
+ - output : pipelineArtifact
76
+ displayName : Publish nuget package
77
+ targetPath : $(Pipeline.Workspace)/staging
78
+ artifact : drop-nuget-package
84
79
steps :
85
- - checkout : self
86
-
87
- - download : core-tools-host
88
- artifact : drop-coretools-host-linux-signed
89
- displayName : " Download core-tools-host linux"
90
-
91
- - download : core-tools-host
92
- artifact : drop-coretools-host-windows
93
- displayName : " Download core-tools-host windows"
94
-
95
- - download : core-tools-inproc
96
- artifact : drop-inproc6
97
- displayName : " Download inproc6 artifact"
98
-
99
- - download : core-tools-inproc
100
- artifact : drop-inproc8
101
- displayName : " Download inproc8 artifact"
80
+ - checkout : none
102
81
103
82
- download : core-tools-default
104
83
artifact : drop
105
84
displayName : " Download out-of-proc artifact"
106
85
107
- - powershell : |
108
- Write-Host "Value of env variable: $(Pipeline.Workspace)"
109
- Write-Host "Artifacts are stored in: D:\a\_work\1"
110
- Get-ChildItem -Path "D:\a\_work\1" -Recurse
111
- displayName: "List Artifact Paths"
112
-
113
86
- powershell : |
114
87
$currentRunName = $env:BUILD_REASON
115
88
Write-Host "Current pipeline run name: $currentRunName"
@@ -135,10 +108,10 @@ extends:
135
108
exit 1
136
109
}
137
110
138
- # Define the destination path in $(Pipeline.Workspace)/nugetPackage
139
- $nugetPackageDirectory = Join-Path -Path $(Pipeline.Workspace) -ChildPath "nugetPackage "
111
+ # Define the destination path in $(Pipeline.Workspace)/staging
112
+ $nugetPackageDirectory = Join-Path -Path $(Pipeline.Workspace) -ChildPath "staging "
140
113
141
- # Create the nugetPackage directory if it doesn't exist
114
+ # Create the staging directory if it doesn't exist
142
115
if (-not (Test-Path $nugetPackageDirectory)) {
143
116
New-Item -Path $nugetPackageDirectory -ItemType Directory
144
117
Write-Host "Directory created at: $nugetPackageDirectory"
@@ -148,31 +121,90 @@ extends:
148
121
Move-Item -Path $fileToMove.FullName -Destination $nugetPackageDirectory -Force
149
122
150
123
Write-Host "File $($fileToMove.Name) moved to $nugetPackageDirectory"
151
- displayName: 'Move Microsoft.Azure.Functions.CoreTools.x.x.xxxx.nupkg to nugetPackage directory'
152
-
124
+ displayName: 'Process Microsoft.Azure.Functions.CoreTools NuGet Package'
125
+
126
+ - job : AssembleArtifacts
127
+ strategy :
128
+ matrix :
129
+ win-x64 :
130
+ artifactName : ' Azure.Functions.Cli.win-x64'
131
+ artifactId : ' win-x64'
132
+ win-x86 :
133
+ artifactName : ' Azure.Functions.Cli.win-x86'
134
+ artifactId : ' win-x86'
135
+ osx-x64 :
136
+ artifactName : ' Azure.Functions.Cli.osx-x64'
137
+ artifactId : ' osx-x64'
138
+ linux-x64 :
139
+ artifactName : ' Azure.Functions.Cli.linux-x64'
140
+ artifactId : ' linux-x64'
141
+ osx-arm64 :
142
+ artifactName : ' Azure.Functions.Cli.osx-arm64'
143
+ artifactId : ' osx-arm64'
144
+ win-arm64 :
145
+ artifactName : ' Azure.Functions.Cli.win-arm64'
146
+ artifactId : ' win-arm64'
147
+ min.win-x64 :
148
+ artifactName : ' Azure.Functions.Cli.min.win-x64'
149
+ artifactId : ' min.win-x64'
150
+ min.win-arm64 :
151
+ artifactName : ' Azure.Functions.Cli.min.win-arm64'
152
+ artifactId : ' min.win-arm64'
153
+ min.win-x86 :
154
+ artifactName : ' Azure.Functions.Cli.min.win-x86'
155
+ artifactId : ' min.win-x86'
156
+ displayName : " Assemble Artifacts"
157
+ templateContext :
158
+ outputs :
159
+ - output : pipelineArtifact
160
+ displayName : Publish assembled artifact $(System.JobPositionInPhase)
161
+ targetPath : $(Build.ArtifactStagingDirectory)
162
+ artifact : drop-$(artifactId)
163
+ - output : pipelineArtifact
164
+ displayName : Publish metadata.json
165
+ targetPath : $(Pipeline.Workspace)/staging/metadata.json
166
+ artifact : drop-metadata-json
167
+ condition : and(succeeded(), eq(variables['artifactName'], 'Azure.Functions.Cli.min.win-x64'))
168
+
169
+ steps :
170
+ - checkout : self
171
+
172
+ - download : core-tools-host
173
+ artifact : drop-coretools-host-linux-signed
174
+ displayName : " Download core-tools-host linux"
175
+
176
+ - download : core-tools-host
177
+ artifact : drop-coretools-host-windows
178
+ displayName : " Download core-tools-host windows"
179
+
180
+ - download : core-tools-inproc
181
+ artifact : drop-inproc6
182
+ displayName : " Download inproc6 artifact"
183
+
184
+ - download : core-tools-inproc
185
+ artifact : drop-inproc8
186
+ displayName : " Download inproc8 artifact"
187
+
188
+ - download : core-tools-default
189
+ artifact : drop
190
+ displayName : " Download out-of-proc artifact"
191
+
153
192
- task : DotNetCoreCLI@2
154
193
displayName : " Run ArtifactAssembler"
155
194
inputs :
156
195
command : run
157
196
projects : " $(Build.SourcesDirectory)/src/Azure.Functions.ArtifactAssembler/Azure.Functions.ArtifactAssembler.csproj"
158
- arguments : ' -c release'
197
+ arguments : ' -c release "$(artifactName)" '
159
198
workingDirectory : ' $(Pipeline.Workspace)'
160
199
161
-
162
- - powershell : |
163
- Write-Host "Value of env variable: $(Pipeline.Workspace)"
164
- Write-Host "Artifacts are stored in: D:\a\_work\1"
165
- Get-ChildItem -Path "D:\a\_work\1" -Recurse
166
- displayName: "List Artifact Paths"
167
-
168
-
169
200
- task : PowerShell@2
170
201
displayName : ' Generate metadata.json file'
171
202
inputs :
172
203
targetType : filePath
173
204
filePath : ' $(Build.SourcesDirectory)/src/Azure.Functions.ArtifactAssembler/PipelineHelpers/generateMetadataFile.ps1'
174
205
arguments : ' -StagingDirectory "$(Pipeline.Workspace)\staging"'
175
206
workingDirectory : ' $(Pipeline.Workspace)'
207
+ condition : and(succeeded(), eq(variables['artifactName'], 'Azure.Functions.Cli.min.win-x64'))
176
208
177
209
- task : PowerShell@2
178
210
displayName : ' Generate MSI files'
@@ -182,8 +214,7 @@ extends:
182
214
arguments : ' -ArtifactsPath "$(Pipeline.Workspace)\staging\coretools-cli"'
183
215
workingDirectory : ' $(Build.SourcesDirectory)/src/Azure.Functions.ArtifactAssembler'
184
216
185
-
186
- - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
217
+ - task : EsrpCodeSigning@5
187
218
displayName : ' ESRP CodeSigning'
188
219
inputs :
189
220
ConnectedServiceName : ' azfunc-internal-esrp'
@@ -226,20 +257,23 @@ extends:
226
257
filePath : ' $(Build.SourcesDirectory)/src/Azure.Functions.ArtifactAssembler/PipelineHelpers/testVsArtifacts.ps1'
227
258
arguments : ' -StagingDirectory "$(Pipeline.Workspace)\staging\coretools-visualstudio"'
228
259
workingDirectory : ' $(Build.SourcesDirectory)/src/Azure.Functions.ArtifactAssembler'
260
+ condition : and(succeeded(), eq(variables['artifactName'], 'Azure.Functions.Cli.min.win-x64'))
261
+
229
262
- task : PowerShell@2
230
263
displayName : ' Test Artifacts'
231
264
inputs :
232
265
targetType : filePath
233
266
filePath : ' $(Build.SourcesDirectory)/src/Azure.Functions.ArtifactAssembler/PipelineHelpers/testArtifacts.ps1'
234
267
arguments : ' -StagingDirectory "$(Pipeline.Workspace)\staging\coretools-cli"'
235
268
workingDirectory : ' $(Build.SourcesDirectory)/src/Azure.Functions.ArtifactAssembler'
269
+ condition : and(succeeded(), or(eq(variables['artifactName'], 'Azure.Functions.Cli.win-x64'), eq(variables['artifactName'], 'Azure.Functions.Cli.win-x86')))
236
270
- task : DotNetCoreCLI@2
237
271
displayName : ' Zip Artifacts'
238
272
inputs :
239
273
command : run
240
274
projects : ' $(Build.SourcesDirectory)/src/Azure.Functions.ArtifactAssembler/Azure.Functions.ArtifactAssembler.csproj'
241
275
arguments : ' zip -c release'
242
- workingDirectory : ' $(Pipeline.Workspace)''
276
+ workingDirectory : ' $(Pipeline.Workspace)'
243
277
- powershell : |
244
278
$rootPath = "$(Pipeline.Workspace)\staging"
245
279
$zipFiles = Get-ChildItem -Path $rootPath -Filter *.zip -Recurse
@@ -250,7 +284,7 @@ extends:
250
284
Out-File -InputObject $sha -Encoding ascii -FilePath $shaFilePath -NoNewline
251
285
Write-Host "Generated sha for $filePath at $shaFilePath"
252
286
}
253
- displayName: ' Generate SHA files'
287
+ displayName: 'Generate SHA files'
254
288
255
289
- pwsh : |
256
290
# Guardian files in TEMP add up and can cause the AntiMalware task to timeout.
@@ -261,11 +295,10 @@ extends:
261
295
displayName : ' Copy Files to Artifact Staging Directory'
262
296
inputs :
263
297
SourceFolder : ' $(Pipeline.Workspace)/staging'
264
- Contents : ' **'
298
+ Contents : ' coretools-*/ **'
265
299
TargetFolder : ' $(Build.ArtifactStagingDirectory)'
266
300
267
301
- powershell : |
268
- Write-Host "Value of env variable: $(Pipeline.Workspace)"
269
302
Write-Host "Artifacts are stored in: D:\a\_work\1"
270
303
Get-ChildItem -Path "D:\a\_work\1\a" -Recurse
271
304
displayName: "List Artifact Paths"
0 commit comments