Merge pull request #11020 from adiaaida/hardenPerf
[platform/upstream/coreclr.git] / buildpipeline / DotNet-Trusted-Publish.json
1 {
2   "build": [
3     {
4       "enabled": true,
5       "continueOnError": false,
6       "alwaysRun": false,
7       "displayName": "Run script $(VS140COMNTOOLS)\\VsDevCmd.bat",
8       "timeoutInMinutes": 0,
9       "task": {
10         "id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
11         "versionSpec": "1.*",
12         "definitionType": "task"
13       },
14       "inputs": {
15         "filename": "$(VS140COMNTOOLS)\\VsDevCmd.bat",
16         "arguments": "",
17         "modifyEnvironment": "true",
18         "workingFolder": "",
19         "failOnStandardError": "false"
20       }
21     },
22     {
23       "enabled": true,
24       "continueOnError": false,
25       "alwaysRun": false,
26       "displayName": "Fetch custom tooling (NuGet, EmbedIndex)",
27       "timeoutInMinutes": 0,
28       "task": {
29         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
30         "versionSpec": "1.*",
31         "definitionType": "task"
32       },
33       "inputs": {
34         "scriptType": "filePath",
35         "scriptName": "scripts/DotNet-Trusted-Publish/Fetch-Tools.ps1",
36         "arguments": "$(Build.StagingDirectory)\\ToolingDownload",
37         "inlineScript": "# You can write your powershell scripts inline here. \n# You can also pass predefined and custom variables to this scripts using arguments\n\n Write-Host \"Hello World\"",
38         "workingFolder": "",
39         "failOnStandardError": "true"
40       }
41     },
42     {
43       "enabled": true,
44       "continueOnError": false,
45       "alwaysRun": false,
46       "displayName": "Set up pipeline-specific git repository",
47       "timeoutInMinutes": 0,
48       "task": {
49         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
50         "versionSpec": "1.*",
51         "definitionType": "task"
52       },
53       "inputs": {
54         "scriptType": "inlineScript",
55         "scriptName": "",
56         "arguments": "-gitUrl $(VstsRepoGitUrl) -root $(Pipeline.SourcesDirectory)",
57         "inlineScript": "param($gitUrl, $root)\n\nif (Test-Path $root)\n{\n  Remove-Item -Recurse -Force $root\n}\ngit clone $gitUrl $root 2>&1 | Write-Host\ncd $root\ngit checkout $env:SourceVersion 2>&1 | Write-Host\n\nWrite-Host (\"##vso[task.setvariable variable=Pipeline.SourcesDirectory;]$root\")",
58         "workingFolder": "",
59         "failOnStandardError": "true"
60       }
61     },
62     {
63       "enabled": true,
64       "continueOnError": false,
65       "alwaysRun": false,
66       "displayName": "sync -ab",
67       "timeoutInMinutes": 0,
68       "task": {
69         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
70         "versionSpec": "1.*",
71         "definitionType": "task"
72       },
73       "inputs": {
74         "scriptType": "inlineScript",
75         "scriptName": "",
76         "arguments": "$(CloudDropAccountName) $(CloudDropAccessToken) $(Label)",
77         "inlineScript": "param($account, $token, $container)\nif ($env:UseLegacyBuildScripts -eq \"true\")\n{\n  .\\sync.cmd /ab /p:CloudDropAccountName=$account /p:CloudDropAccessToken=$token /p:ContainerName=$container\n}\nelse\n{\n#  .\\sync.cmd -ab \"-AzureAccount=$account\" \"-AzureToken=$token\" \"-Container=$container\"\n  .\\init-tools.cmd\n  msbuild src\\syncAzure.proj /p:CloudDropAccountName=$account /p:CloudDropAccessToken=$token /p:ContainerName=$container\n}",
78         "workingFolder": "$(Pipeline.SourcesDirectory)",
79         "failOnStandardError": "false"
80       }
81     },
82     {
83       "enabled": true,
84       "continueOnError": false,
85       "alwaysRun": false,
86       "displayName": "Index symbol packages",
87       "timeoutInMinutes": 0,
88       "task": {
89         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
90         "versionSpec": "1.*",
91         "definitionType": "task"
92       },
93       "inputs": {
94         "scriptType": "inlineScript",
95         "scriptName": "",
96         "arguments": "",
97         "inlineScript": "if ($env:ConfigurationGroup -ne \"Release\") { exit }\n\n& $env:Build_SourcesDirectory\\scripts\\DotNet-Trusted-Publish\\Embed-Index.ps1 `\n  $env:Pipeline_SourcesDirectory\\packages\\AzureTransfer\\$env:ConfigurationGroup\\$env:AzureContainerSymbolPackageGlob `\n  $env:Build_StagingDirectory\\IndexedSymbolPackages",
98         "workingFolder": "",
99         "failOnStandardError": "true"
100       }
101     },
102     {
103       "enabled": true,
104       "continueOnError": false,
105       "alwaysRun": false,
106       "displayName": "Generate Version Assets",
107       "timeoutInMinutes": 0,
108       "task": {
109         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
110         "versionSpec": "1.*",
111         "definitionType": "task"
112       },
113       "inputs": {
114         "scriptType": "inlineScript",
115         "scriptName": "",
116         "arguments": "",
117         "inlineScript": "#if ($env:UseLegacyBuildScripts -eq \"true\")\n#{\n  msbuild build.proj /t:CreateOrUpdateCurrentVersionFile /p:OfficialBuildId=$env:OfficialBuildId /p:BuildVersionFile=bin\\obj\\BuildVersion-$env:OfficialBuildId.props\n#}\n#else\n#{\n#  .\\build-managed.cmd -GenerateVersion \"-OfficialBuildId=$env:OfficialBuildId\"\n#}",
118         "workingFolder": "$(Pipeline.SourcesDirectory)",
119         "failOnStandardError": "true"
120       }
121     },
122     {
123       "enabled": true,
124       "continueOnError": true,
125       "alwaysRun": false,
126       "displayName": "Log Native Version Assets Files",
127       "timeoutInMinutes": 0,
128       "task": {
129         "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
130         "versionSpec": "1.*",
131         "definitionType": "task"
132       },
133       "inputs": {
134         "filename": "dir",
135         "arguments": "$(Pipeline.SourcesDirectory)\\bin\\obj\\BuildVersion*",
136         "workingFolder": "",
137         "failOnStandardError": "false"
138       }
139     },
140     {
141       "enabled": true,
142       "continueOnError": false,
143       "alwaysRun": false,
144       "displayName": "packages -> dotnet.myget.org",
145       "timeoutInMinutes": 0,
146       "task": {
147         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
148         "versionSpec": "1.*",
149         "definitionType": "task"
150       },
151       "inputs": {
152         "scriptType": "inlineScript",
153         "scriptName": "",
154         "arguments": "$(MyGetApiKey) $(ConfigurationGroup)",
155         "inlineScript": "param($ApiKey, $ConfigurationGroup)\nif ($ConfigurationGroup -ne \"Release\") { exit }\n& $env:CustomNuGetPath push $env:Pipeline_SourcesDirectory\\packages\\AzureTransfer\\$env:ConfigurationGroup\\$env:AzureContainerPackageGlob $ApiKey -Source $env:MyGetFeedUrl -Timeout 3600",
156         "workingFolder": "",
157         "failOnStandardError": "true"
158       }
159     },
160     {
161       "enabled": true,
162       "continueOnError": false,
163       "alwaysRun": false,
164       "displayName": "symbol packages -> dotnet.myget.org",
165       "timeoutInMinutes": 0,
166       "task": {
167         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
168         "versionSpec": "1.*",
169         "definitionType": "task"
170       },
171       "inputs": {
172         "scriptType": "inlineScript",
173         "scriptName": "",
174         "arguments": "$(MyGetApiKey) $(ConfigurationGroup)",
175         "inlineScript": "param($ApiKey, $ConfigurationGroup)\nif ($ConfigurationGroup -ne \"Release\") { exit }\n& $env:CustomNuGetPath push $env:Build_StagingDirectory\\IndexedSymbolPackages\\*.nupkg $ApiKey -Source $env:MyGetFeedUrl -Timeout 3600",
176         "workingFolder": "",
177         "failOnStandardError": "true"
178       }
179     },
180     {
181       "enabled": false,
182       "continueOnError": false,
183       "alwaysRun": false,
184       "displayName": "Create VSTS auth NuGet.Config",
185       "timeoutInMinutes": 0,
186       "task": {
187         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
188         "versionSpec": "1.*",
189         "definitionType": "task"
190       },
191       "inputs": {
192         "scriptType": "inlineScript",
193         "scriptName": "",
194         "arguments": "$(VstsAuthedNuGetConfigPath) $(VstsFeedUrl) $(VstsPat)",
195         "inlineScript": "param($path, $url, $pat)\n\nSet-Content $path @\"\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <packageSources>\n    <add key=\"vsts-dotnet-core\" value=\"$url\" />\n  </packageSources>\n  <packageSourceCredentials>\n    <vsts-dotnet-core>\n      <add key=\"Username\" value=\"VssSessionToken\" />\n      <add key=\"ClearTextPassword\" value=\"$pat\" />\n    </vsts-dotnet-core>\n  </packageSourceCredentials>\n</configuration>\n\"@",
196         "workingFolder": "",
197         "failOnStandardError": "true"
198       }
199     },
200     {
201       "enabled": false,
202       "continueOnError": false,
203       "alwaysRun": false,
204       "displayName": "packages -> VSTS",
205       "timeoutInMinutes": 0,
206       "task": {
207         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
208         "versionSpec": "1.*",
209         "definitionType": "task"
210       },
211       "inputs": {
212         "scriptType": "inlineScript",
213         "scriptName": "",
214         "arguments": "",
215         "inlineScript": "if ($env:ConfigurationGroup -ne \"Release\") { exit }\n& $env:CustomNuGetPath push $env:Pipeline.SourcesDirectory\\packages\\AzureTransfer\\$env:ConfigurationGroup\\$env:AzureContainerPackageGlob placeholderapikey -Source vsts-dotnet-core -ConfigFile $env:VstsAuthedNuGetConfigPath -Timeout 3600",
216         "workingFolder": "",
217         "failOnStandardError": "true"
218       }
219     },
220     {
221       "enabled": true,
222       "continueOnError": false,
223       "alwaysRun": false,
224       "displayName": "Update versions repository",
225       "timeoutInMinutes": 0,
226       "task": {
227         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
228         "versionSpec": "1.*",
229         "definitionType": "task"
230       },
231       "inputs": {
232         "scriptType": "inlineScript",
233         "scriptName": "",
234         "arguments": "-gitHubAuthToken $(UpdatePublishedVersions.AuthToken) -root $(Pipeline.SourcesDirectory) -configGroup $(ConfigurationGroup)",
235         "inlineScript": "param($gitHubAuthToken, $root, $configGroup)\nif ($configGroup -ne \"Release\") { exit }\ncd $root\n. $root\\UpdatePublishedVersions.ps1 `\n  -gitHubUser dotnet-build-bot -gitHubEmail dotnet-build-bot@microsoft.com `\n  -gitHubAuthToken $gitHubAuthToken `\n  -versionsRepoOwner $env:VersionsRepoOwner -versionsRepo versions `\n  -versionsRepoPath build-info/dotnet/$env:GitHubRepositoryName/$env:SourceBranch `\n  -nupkgPath $root\\packages\\AzureTransfer\\$env:ConfigurationGroup\\$env:AzureContainerPackageGlob",
236         "workingFolder": "",
237         "failOnStandardError": "true"
238       }
239     },
240     {
241       "enabled": true,
242       "continueOnError": false,
243       "alwaysRun": false,
244       "displayName": "Get Build Number",
245       "timeoutInMinutes": 0,
246       "task": {
247         "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
248         "versionSpec": "1.*",
249         "definitionType": "task"
250       },
251       "inputs": {
252         "scriptType": "inlineScript",
253         "scriptName": "",
254         "arguments": "$(OfficialBuildId) $(Pipeline.SourcesDirectory)",
255         "inlineScript": "param(\n  [string]$OfficialBuildId,\n  [string]$SourcesDir\n)\n$VersionPropsFile=$SourcesDir + \"\\bin\\obj\\BuildVersion-\" + $OfficialBuildId + \".props\"\n[xml]$versionXml=Get-Content $VersionPropsFile\n$env:BuildNumber=$versionXml.Project.PropertyGroup.BuildNumberMajor.InnerText + \".\" + $versionXml.Project.PropertyGroup.BuildNumberMinor.InnerText\nWrite-Host (\"##vso[task.setvariable variable=BuildNumber;]$env:BuildNumber\")",
256         "workingFolder": "",
257         "failOnStandardError": "true"
258       }
259     },
260     {
261       "enabled": true,
262       "continueOnError": true,
263       "alwaysRun": false,
264       "displayName": "Publish to Artifact Services Drop (OfficialBuildId)",
265       "timeoutInMinutes": 0,
266       "task": {
267         "id": "f9d96d25-0c81-4e77-8282-1ad1f785cbb4",
268         "versionSpec": "0.*",
269         "definitionType": "task"
270       },
271       "inputs": {
272         "dropServiceURI": "https://devdiv.artifacts.visualstudio.com/DefaultCollection",
273         "buildNumber": "dotnet/$(GitHubRepositoryName)/$(SourceBranch)/$(OfficialBuildId)/packages/$(ConfigurationGroup)",
274         "sourcePath": "$(Pipeline.SourcesDirectory)\\packages\\AzureTransfer\\$(ConfigurationGroup)",
275         "dropExePath": "",
276         "toLowerCase": "true",
277         "detailedLog": "false",
278         "usePat": "false",
279         "retentionDays": "",
280         "dropMetadataContainerName": "DropMetadata"
281       }
282     },
283     {
284       "enabled": true,
285       "continueOnError": true,
286       "alwaysRun": false,
287       "displayName": "Publish to Artifact Services Drop (BuildNumber)",
288       "timeoutInMinutes": 0,
289       "task": {
290         "id": "f9d96d25-0c81-4e77-8282-1ad1f785cbb4",
291         "versionSpec": "0.*",
292         "definitionType": "task"
293       },
294       "inputs": {
295         "dropServiceURI": "https://devdiv.artifacts.visualstudio.com/DefaultCollection",
296         "buildNumber": "dotnet/$(GitHubRepositoryName)/$(SourceBranch)/$(BuildNumber)/packages/$(ConfigurationGroup)",
297         "sourcePath": "$(Pipeline.SourcesDirectory)\\packages\\AzureTransfer\\$(ConfigurationGroup)",
298         "dropExePath": "",
299         "toLowerCase": "true",
300         "detailedLog": "false",
301         "usePat": "false",
302         "retentionDays": "",
303         "dropMetadataContainerName": "DropMetadata"
304       }
305     },
306     {
307       "enabled": true,
308       "continueOnError": false,
309       "alwaysRun": true,
310       "displayName": "Copy Publish Artifact: PublishLogs",
311       "timeoutInMinutes": 0,
312       "task": {
313         "id": "1d341bb0-2106-458c-8422-d00bcea6512a",
314         "versionSpec": "1.*",
315         "definitionType": "task"
316       },
317       "inputs": {
318         "CopyRoot": "",
319         "Contents": "$(Pipeline.SourcesDirectory)\\*.log",
320         "ArtifactName": "PublishLogs",
321         "ArtifactType": "Container",
322         "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)"
323       }
324     },
325     {
326       "enabled": true,
327       "continueOnError": true,
328       "alwaysRun": true,
329       "displayName": "Copy Publish Artifact: debuggerlogs",
330       "timeoutInMinutes": 0,
331       "task": {
332         "id": "1d341bb0-2106-458c-8422-d00bcea6512a",
333         "versionSpec": "1.*",
334         "definitionType": "task"
335       },
336       "inputs": {
337         "CopyRoot": "$(Pipeline.SourcesDirectory)",
338         "Contents": "**/*.log",
339         "ArtifactName": "DebugLogs",
340         "ArtifactType": "Container",
341         "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)"
342       }
343     }
344   ],
345   "options": [
346     {
347       "enabled": false,
348       "definition": {
349         "id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
350       },
351       "inputs": {
352         "additionalFields": "{}"
353       }
354     },
355     {
356       "enabled": false,
357       "definition": {
358         "id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
359       },
360       "inputs": {
361         "multipliers": "[]",
362         "parallel": "false",
363         "continueOnError": "true",
364         "additionalFields": "{}"
365       }
366     },
367     {
368       "enabled": false,
369       "definition": {
370         "id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
371       },
372       "inputs": {
373         "workItemType": "234347",
374         "assignToRequestor": "true",
375         "additionalFields": "{}"
376       }
377     },
378     {
379       "enabled": false,
380       "definition": {
381         "id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
382       },
383       "inputs": {
384         "additionalFields": "{}"
385       }
386     }
387   ],
388   "variables": {
389     "system.debug": {
390       "value": "false",
391       "allowOverride": true
392     },
393     "ConfigurationGroup": {
394       "value": "$(PB_BuildType)",
395       "allowOverride": true
396     },
397     "TeamName": {
398       "value": "DotNetCore"
399     },
400     "CloudDropAccountName": {
401       "value": "dotnetbuildoutput",
402       "allowOverride": true
403     },
404     "CloudDropAccessToken": {
405       "value": null,
406       "allowOverride": true,
407       "isSecret": true
408     },
409     "OfficialBuildId": {
410       "value": "$(Build.BuildNumber)",
411       "allowOverride": true
412     },
413     "Label": {
414       "value": "$(Build.BuildNumber)",
415       "allowOverride": true
416     },
417     "MyGetFeedUrl": {
418       "value": "https://dotnet.myget.org/F/dotnet-core-test/api/v2/package",
419       "allowOverride": true
420     },
421     "MyGetApiKey": {
422       "value": null,
423       "allowOverride": true,
424       "isSecret": true
425     },
426     "VstsFeedUrl": {
427       "value": "https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/dotnet-core-test/nuget/v3/index.json",
428       "allowOverride": true
429     },
430     "VstsPat": {
431       "value": null,
432       "allowOverride": true,
433       "isSecret": true
434     },
435     "VstsAuthedNuGetConfigPath": {
436       "value": "$(Build.StagingDirectory)\\VstsAuthed.NuGet.Config"
437     },
438     "UpdatePublishedVersions.AuthToken": {
439       "value": null,
440       "allowOverride": true,
441       "isSecret": true
442     },
443     "VersionsRepoOwner": {
444       "value": "dagood",
445       "allowOverride": true
446     },
447     "BuildConfiguration": {
448       "value": "release"
449     },
450     "BuildPlatform": {
451       "value": "any cpu"
452     },
453     "ReleaseBaseUrl": {
454       "value": "https://devdiv.vsrm.visualstudio.com/DefaultCollection",
455       "allowOverride": true
456     },
457     "ReleaseProjectName": {
458       "value": "DevDiv",
459       "allowOverride": true
460     },
461     "ReleaseDefinitionId": {
462       "value": "40",
463       "allowOverride": true
464     },
465     "ManualReleaseName": {
466       "value": ""
467     },
468     "OfficialBuild": {
469       "value": "fake-test"
470     },
471     "BranchGroup": {
472       "value": ""
473     },
474     "SymbolRoot": {
475       "value": "\\\\fake\\symbol\\root"
476     },
477     "DefinitionNames": {
478       "value": "Fake-Windows Fake-Windows-Native"
479     },
480     "CreateRequestContacts": {
481       "value": "a b c"
482     },
483     "VstsReleaseAccessToken": {
484       "value": null,
485       "allowOverride": true,
486       "isSecret": true
487     },
488     "Pipeline.SourcesDirectory": {
489       "value": "$(Build.BinariesDirectory)\\pipelineRepository"
490     },
491     "VstsAccountName": {
492       "value": "dagood",
493       "allowOverride": true
494     },
495     "VstsRepositoryName": {
496       "value": "DotNet-CoreFX-Trusted",
497       "allowOverride": true
498     },
499     "VstsRepoGitUrl": {
500       "value": "https://$(VstsAccountName):$(VstsRepoPat)@devdiv.visualstudio.com/DevDiv/_git/$(VstsRepositoryName)/"
501     },
502     "VstsRepoPat": {
503       "value": null,
504       "allowOverride": true,
505       "isSecret": true
506     },
507     "SourceVersion": {
508       "value": "master",
509       "allowOverride": true
510     },
511     "SourceBranch": {
512       "value": "master",
513       "allowOverride": true
514     },
515     "AzureContainerPackageGlob": {
516       "value": "*.nupkg",
517       "allowOverride": true
518     },
519     "AzureContainerSymbolPackageGlob": {
520       "value": "symbols\\*.nupkg",
521       "allowOverride": true
522     },
523     "GitHubRepositoryName": {
524       "value": "corefx",
525       "allowOverride": true
526     },
527     "UseLegacyBuildScripts": {
528       "value": "false",
529       "allowOverride": true
530     }
531   },
532   "retentionRules": [
533     {
534       "branches": [
535         "+refs/heads/*"
536       ],
537       "artifacts": [],
538       "artifactTypesToDelete": [
539         "FilePath",
540         "SymbolStore"
541       ],
542       "daysToKeep": 10,
543       "minimumToKeep": 1,
544       "deleteBuildRecord": true,
545       "deleteTestResults": true
546     }
547   ],
548   "buildNumberFormat": "$(date:yyyyMMdd)$(rev:-rr)",
549   "jobAuthorizationScope": "projectCollection",
550   "jobTimeoutInMinutes": 180,
551   "repository": {
552     "properties": {
553       "labelSources": "0",
554       "reportBuildStatus": "false",
555       "fetchDepth": "0",
556       "gitLfsSupport": "false",
557       "skipSyncSource": "false",
558       "cleanOptions": "0"
559     },
560     "id": "0a2b2664-c1be-429c-9b40-8a24dee27a4a",
561     "type": "TfsGit",
562     "name": "DotNet-BuildPipeline",
563     "url": "https://devdiv.visualstudio.com/DevDiv/_git/DotNet-BuildPipeline",
564     "defaultBranch": "refs/heads/master",
565     "clean": "true",
566     "checkoutSubmodules": false
567   },
568   "quality": "definition",
569   "queue": {
570     "pool": {
571       "id": 39,
572       "name": "DotNet-Build"
573     },
574     "id": 36,
575     "name": "DotNet-Build"
576   },
577   "path": "\\",
578   "type": "build",
579   "id": 2943,
580   "name": "DotNet-Trusted-Publish",
581   "url": "https://devdiv.visualstudio.com/DefaultCollection/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_apis/build/Definitions/2943",
582   "project": {
583     "id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
584     "name": "DevDiv",
585     "description": "Visual Studio and DevDiv team project for git source code repositories.  Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv.  ",
586     "url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
587     "state": "wellFormed",
588     "revision": 418097633
589   }
590 }