-
Notifications
You must be signed in to change notification settings - Fork 59
/
azure-pipelines.yml
1521 lines (1187 loc) · 49.1 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# 'Allow scripts to access the OAuth token' was selected in pipeline. Add the following YAML to any steps requiring access:
# env:
# MY_ACCESS_TOKEN: $(System.AccessToken)
# Variable 'ArtifactServices.Symbol.AccountName' was defined in the Variables tab
# Variable 'ArtifactServices.Symbol.PAT' was defined in the Variables tab
# Variable 'ArtifactServices.Symbol.UseAAD' was defined in the Variables tab
# Variable 'DropRoot' was defined in the Variables tab
# Variable 'ForceProductionBuild' was defined in the Variables tab
# Variable 'ForceStagingBuild' was defined in the Variables tab
# Variable 'MSI_BuildVersion' was defined in the Variables tab
# Variable 'RunTests' was defined in the Variables tab
# Variable 'skipComponentGovernanceDetection' was defined in the Variables tab
# Variable 'system.prefergit' was defined in the Variables tab
# Variable 'TeamName' was defined in the Variables tab
# Variable 'TelemetryType' was defined in the Variables tab
parameters:
- name: TelemetryType
displayName: Telemetry Type so that correct application insights key is selected
default: 'TELEMETRY_DEVELOPMENT'
values:
- TELEMETRY_DEVELOPMENT
- TELEMETRY_STAGING
- TELEMETRY_PRODUCTION
- name: BuildConfiguration
displayName: BuildConfiguration to be used
default: 'Release'
values:
- Release
- Debug
variables:
- name: BuildParameters.dotnetversion
value: 7.0.x
- name: BuildParameters.dotnetversionforbuild
value: net7.0
- name: BuildParameters.nugetversion
value: 5.9.x
- name: TeamName
value: Mindaro
- name: RunTests
value: True
# A pipeline with no CI trigger since this is a signed build needs to be triggered manually.
trigger: none
name: $(date:yyyyMMdd)$(rev:.r)
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
jobs:
- job: Phase_1
displayName: Run self-contained build (binaries V1, where the binaries are all bundled together)
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
pool:
name: 'VSEngSS-MicroBuild2022-1ES'
demands:
- msbuild
- visualstudio
- DotNetFramework
steps:
- checkout: self
clean: true
fetchTags: false
persistCredentials: True
- task: PowerShell@2
displayName: Set staging/prod build vars for signing and telemetry copy
enabled: True
inputs:
targetType: inline
script: >-
if ($env:ForceStagingBuild -eq "true" -And $env:ForceProductionBuild -eq "true") {
Write-Host "You can't do a Staging and Production build at the same time... Duh...."
exit 1
}
$branchName = $env:BUILD_SOURCEBRANCH
if ($branchName -eq "refs/heads/main") {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for main branch"
} else {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for other branch"
}
Write-Host "##vso[task.setvariable variable=MicroBuild_NuPkgSigningEnabled;]true"
- task: MicroBuildSigningPlugin@3
name: ''
displayName: Install Signing Plugin
enabled: True
inputs:
signType: real
zipSources: false
- task: MicroBuildLocalizationPlugin@3
displayName: 'Install Localization Plugin'
enabled: True
- task: UseDotNet@2
displayName: Use .NET Core SDK 7.0.x
enabled: True
inputs:
version: $(BuildParameters.dotnetversion)
installationPath: $(Agent.TempDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: restore EndpointManager (Windows) (to download runtime pack)
enabled: True
inputs:
command: restore
projects: src\endpointmanager\endpointmanager.csproj
restoreArguments: -r win-x64
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: DotNetCoreCLI@2
displayName: restore EndpointManager for arm64 (Windows) (to download runtime pack)
enabled: True
inputs:
command: restore
projects: src\endpointmanager\endpointmanager.csproj
restoreArguments: -r win-arm64
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: NuGetToolInstaller@1
name: ''
displayName: Use NuGet 5.9.x
enabled: True
inputs:
versionSpec: $(BuildParameters.nugetversion)
- task: NuGetCommand@2
name: ''
displayName: NuGet restore client.sln
enabled: True
inputs:
solution: src/client.sln
selectOrConfig: config
feedRestore: fc5819b5-ed1c-4a51-9766-a55ddb558d72
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
verbosityRestore: Normal
searchPatternPush: $(Build.ArtifactStagingDirectory)/*.nupkg
- task: VSBuild@1
name: ''
displayName: Build client.sln for Loc and Tests
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
solution: src/client.sln
msbuildArgs: -p:Localize=true -p:ConsumeEndpointManager=false
configuration: ${{ parameters.BuildConfiguration }}
- task: VSTest@2
displayName: Run Unit Tests
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
testAssemblyVer2: '**\bin\${{ parameters.BuildConfiguration }}\*\*Tests.dll'
runSettingsFile: tests/unittests/dotnetcore.runsettings
runInParallel: true
codeCoverageEnabled: True
testRunTitle: Unit Tests
failOnMinTestsNotRun: true
rerunFailedTests: true
- task: CopyFiles@2
displayName: Collect Loc files
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
Contents: >-
src/*/bin/*/*/localize/**/*
src/*/bin/**/*.lce
src/dsc/bin/*/*/dsc.dll
src/endpointmanager/bin/*/*/endpointmanager.dll
src/common/bin/*/*/Microsoft.BridgeToKubernetes.Common.dll
src/library/bin/*/*/Microsoft.BridgeToKubernetes.Library.dll
TargetFolder: $(Build.ArtifactStagingDirectory)/Loc
OverWrite: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Loc'
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/Loc
ArtifactName: Loc
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
- task: DotNetCoreCLI@2
displayName: publish DSC (Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-x64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish DSC for arm 64 (Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-arm64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish EndpointManagerLauncher(Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\EndpointManagerLauncher\endpointmanagerlauncher.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-x64 --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish EndpointManagerLauncher for arm64 (Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\EndpointManagerLauncher\endpointmanagerlauncher.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-arm64 --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: CopyFiles@2
displayName: Copy EndpointManager Launcher to dsc folder
enabled: True
inputs:
SourceFolder: src/EndpointManagerLauncher/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/
Contents: >-
**/*
!**/*.pdb
TargetFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/EndpointManagerLauncher
OverWrite: true
- task: CopyFiles@2
displayName: Copy EndpointManager Launcher to dsc folder for arm 64
enabled: True
inputs:
SourceFolder: src/EndpointManagerLauncher/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/
Contents: >-
**/*
!**/*.pdb
TargetFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/EndpointManagerLauncher
OverWrite: true
- task: DotNetCoreCLI@2
displayName: publish DSC (OSX)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r osx-x64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (OSX)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r osx-arm64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish DSC (Linux)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r linux-x64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (Linux)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r linux-arm64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: PowerShell@2
displayName: Download kubectl
continueOnError: True
enabled: True
inputs:
targetType: inline
script: >
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl' -ItemType Directory
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl/win' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/windows/amd64/kubectl.exe -OutFile ./src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl/win/kubectl.exe
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl' -ItemType Directory
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl/osx' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/darwin/amd64/kubectl -OutFile ./src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl/osx/kubectl
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl' -ItemType Directory
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl/linux' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl -OutFile ./src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl/linux/kubectl
- task: PowerShell@2
displayName: Download kubectl for arm64
continueOnError: True
inputs:
targetType: inline
script: >
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl/win' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/windows/arm64/kubectl.exe -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl/win/kubectl.exe
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/kubectl/osx' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/darwin/arm64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/kubectl/osx/kubectl
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl/linux' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/linux/arm64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl/linux/kubectl
- task: VSBuild@1
name: ''
displayName: Sign Files
enabled: True
inputs:
solution: src/client.signproj
msbuildArgs: /t:SignFiles /p:SignType=real
configuration: '${{ parameters.BuildConfiguration }} '
- task: CopyFiles@2
displayName: Collect files for .zip (Windows)
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish
Contents: >-
**/*
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/win
- task: CopyFiles@2
displayName: Collect files for .zip (Windows) for arm64
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish
Contents: >-
**/*
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/winarm64
- task: CopyFiles@2
displayName: Collect files for .zip (OSX)
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/osx
- task: CopyFiles@2
displayName: Collect files for .zip (OSX) for arm64
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/osxarm64
- task: CopyFiles@2
displayName: Collect files for .zip (Linux)
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/linux
- task: CopyFiles@2
displayName: Collect files for .zip (Linux) for arm64
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/linuxarm64
- task: ArchiveFiles@2
displayName: Create .zip file (Windows)
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/win
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-win.zip
- task: ArchiveFiles@2
displayName: Create .zip file (Windows) for arm64
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/winarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-win-arm64.zip
- task: ArchiveFiles@2
displayName: Create .zip file (OSX)
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/osx
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-osx.zip
- task: ArchiveFiles@2
displayName: Create .zip file (OSX) for arm64
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/osxarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-osx-arm64.zip
- task: ArchiveFiles@2
displayName: Create .zip file (Linux)
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/linux
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-linux.zip
- task: ArchiveFiles@2
displayName: Create .zip file (Linux) for arm64
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/linuxarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-linux-arm64.zip
- task: PowerShell@2
displayName: Generate lks.json for .zip files
enabled: True
inputs:
targetType: inline
script: >-
$ZipHost = "mindaromaster.blob.core.windows.net"
$BlobUrl = "https://$ZipHost/zip/1.0.$env:BUILD_BUILDNUMBER"
$ZipDir = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/zip"
$Win = @{ url="$BlobUrl/lpk-win.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-win.zip).Hash)" }
$OSX = @{ url="$BlobUrl/lpk-osx.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-osx.zip).Hash)" }
$Linux = @{ url="$BlobUrl/lpk-linux.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-linux.zip).Hash)" }
$Win_Arm64 = @{ url="$BlobUrl/lpk-win-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-win-arm64.zip).Hash)" }
$OSX_Arm64 = @{ url="$BlobUrl/lpk-osx-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-osx-arm64.zip).Hash)" }
$Linux_Arm64 = @{ url="$BlobUrl/lpk-linux-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-linux-arm64.zip).Hash)" }
$Json = @{ version="1.0.$env:BUILD_BUILDNUMBER"; win = $Win; osx = $OSX; linux = $Linux; win_arm64 = $Win_Arm64; linux_arm64 = $Linux_Arm64; osx_arm64 = $OSX_Arm64 } | ConvertTo-Json
$Json | Out-File -FilePath $ZipDir/lks.json -Encoding ascii
New-Item -ItemType directory -Path $ZipDir/1.0.$env:BUILD_BUILDNUMBER
$Json | Out-File -FilePath $ZipDir/1.0.$env:BUILD_BUILDNUMBER/lks.json -Encoding ascii
Write-Host $Json
- task: ManifestGeneratorTask@0
displayName: Manifest Generator for zip
enabled: True
inputs:
BuildDropPath: $(Build.ArtifactStagingDirectory)/zip
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: zip'
enabled: True
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/zip
ArtifactName: zip
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
- task: DotNetCoreCLI@2
displayName: 'dotnet pack CLI NuGet (Windows)'
inputs:
command: pack
feedsToUse: config
packagesToPack: src/dsc/dsc.csproj
packDirectory: '$(Build.ArtifactStagingDirectory)/nuget'
nobuild: true
buildProperties: 'Configuration=${{ parameters.BuildConfiguration }};NuspecFile=bin\${{ parameters.BuildConfiguration }}\$(BuildParameters.dotnetversionforbuild)\win-x64\publish\dsc.nuspec'
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'Manifest Generator for nuget'
inputs:
BuildDropPath: '$(Build.ArtifactStagingDirectory)/nuget'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: nuget'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/nuget'
ArtifactName: nuget
- task: CodeSign@1
displayName: Validate Signatures nuget
inputs:
Path: '$(Build.ArtifactStagingDirectory)/nuget'
- task: CopyFiles@2
displayName: Collect Build Symbols - dsc
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)
Contents: >-
*/publish/dsc.?(pdb|exe|dll|)
*/publish/Microsoft.BridgeToKubernetes.*.@(pdb|exe|dll|)
*/publish/EndpointManager/EndpointManager.?(pdb|exe|dll|)
*/publish/EndpointManager/Microsoft.BridgeToKubernetes.*.@(pdb|exe|dll|)
TargetFolder: $(Build.ArtifactStagingDirectory)/symbols
OverWrite: true
- task: PublishSymbols@2
displayName: Enable Source Server
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
SymbolsFolder: $(Build.ArtifactStagingDirectory)/symbols
SearchPattern: '**/*.pdb'
SymbolServerType: TeamServices
- task: CopyFiles@2
displayName: Copy buildWindowsPDBs.ps1 to artifact directory
enabled: True
inputs:
SourceFolder: build
Contents: buildWindowsPDBs.ps1
TargetFolder: $(Build.ArtifactStagingDirectory)/symbols/
OverWrite: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: symbols'
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/symbols
ArtifactName: symbols
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
- task: tagBuildOrRelease@0
displayName: Tag BuildConfiguration
enabled: True
inputs:
tags: 'BuildConfiguration: ${{ parameters.BuildConfiguration }}'
- task: SdtReport@2
inputs:
GdnExportAllTools: true
GdnExportHtmlFile: true
- task: PublishSecurityAnalysisLogs@3
inputs:
ArtifactName: 'CodeAnalysisLogs'
ArtifactType: 'Container'
AllTools: true
ToolLogsNotFoundAction: 'Standard'
- task: PostAnalysis@2
inputs:
GdnBreakAllTools: true
GdnBreakFast: true
- job: Phase_2
displayName: Run NON self-contained build (binaries V2, where the binaries are downloaded in parallel)
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
pool:
name: 'VSEngSS-MicroBuild2022-1ES'
demands:
- msbuild
- visualstudio
- vstest
steps:
- checkout: self
clean: true
fetchTags: false
persistCredentials: True
- task: PowerShell@2
displayName: Set staging/prod build vars for signing and telemetry
inputs:
targetType: inline
script: >-
$branchName = $env:BUILD_SOURCEBRANCH
if ($branchName -eq "refs/heads/main") {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for main branch"
} else {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for other branch"
}
Write-Host "##vso[task.setvariable variable=MicroBuild_NuPkgSigningEnabled;]true"
- task: MicroBuildSigningPlugin@3
displayName: Install Signing Plugin
enabled: True
inputs:
signType: real
zipSources: false
- task: MicroBuildLocalizationPlugin@3
displayName: Install Localization Plugin
- task: UseDotNet@2
displayName: Use .NET Core SDK 7.0.X
inputs:
version: $(BuildParameters.dotnetversion)
installationPath: $(Agent.TempDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: restore EndpointManager (Windows) (to download runtime pack)
inputs:
command: restore
projects: src\endpointmanager\endpointmanager.csproj
restoreArguments: -r win-x64
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: DotNetCoreCLI@2
displayName: restore EndpointManager for ARM 64 (Windows) (to download runtime pack)
inputs:
command: restore
projects: src\endpointmanager\endpointmanager.csproj
restoreArguments: -r win-arm64
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: NuGetToolInstaller@1
displayName: Use NuGet 6.1.x
inputs:
versionSpec: 6.1.x
- task: NuGetCommand@2
displayName: NuGet restore client.sln
inputs:
solution: src/client.sln
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: DotNetCoreCLI@2
displayName: publish DSC (Windows)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-x64 --self-contained false --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (Windows)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-arm64 --self-contained false --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: DotNetCoreCLI@2
displayName: publish EndpointManagerLauncher(Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\EndpointManagerLauncher\endpointmanagerlauncher.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-x64 --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish EndpointManagerLauncher for arm64 (Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\EndpointManagerLauncher\endpointmanagerlauncher.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-arm64 --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: CopyFiles@2
displayName: Copy EndpointManager Launcher to dsc folder
enabled: True
inputs:
SourceFolder: src/EndpointManagerLauncher/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/
Contents: >-
**/*
!**/*.pdb
TargetFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/EndpointManagerLauncher
OverWrite: true
- task: CopyFiles@2
displayName: Copy EndpointManager Launcher to dsc folder for arm64
enabled: True
inputs:
SourceFolder: src/EndpointManagerLauncher/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/
Contents: >-
**/*
!**/*.pdb
TargetFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/EndpointManagerLauncher
OverWrite: true
- task: DotNetCoreCLI@2
displayName: publish DSC (OSX)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r osx-x64 --no-restore --self-contained false --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: DotNetCoreCLI@2
displayName: publish DSC (Linux)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r linux-x64 --no-restore --self-contained false --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (Linux)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r linux-arm64 --no-restore --self-contained false --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: PowerShell@2
displayName: Download kubectl
continueOnError: True
inputs:
targetType: inline
script: >
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl/win' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/windows/amd64/kubectl.exe -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl/win/kubectl.exe
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl/osx' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/darwin/amd64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl/osx/kubectl
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl/linux' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl/linux/kubectl
- task: PowerShell@2
displayName: Download kubectl for arm64
continueOnError: True
inputs:
targetType: inline
script: >
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl/win' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/windows/arm64/kubectl.exe -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl/win/kubectl.exe
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl/linux' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/linux/arm64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl/linux/kubectl
- task: VSBuild@1
displayName: Sign Files
enabled: True
inputs:
solution: src/client.signproj