forked from nanoframework/nf-interpreter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
1245 lines (1088 loc) · 39.8 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
trigger:
branches:
include:
- main
- develop*
- release-*
- refs/tags/*
paths:
exclude:
- .clang-format
- .github_changelog_generator
- .gitignore
- .typo-ci.yml
- build.ps1
- CHANGELOG.md
- CMakeSettings.json
- CMakeSettings.SAMPLE.json
- LICENSE.md
- nf.props
- nfcore.vssettings
- README.md
- README.zh-cn.md
- RunCmd.bat
- startocd.bat
- .github/*
- .devcontainer/*
- .vscode/*
- .vs/*
- assets/*
- config/*
- install-scripts/*
- VisualStudioDevelopment/*
pr:
autoCancel: true
# add nf-tools repo to resources (for Azure Pipelines templates)
resources:
repositories:
- repository: templates
type: github
name: nanoframework/nf-tools
endpoint: nanoframework
- repository: esp32_idf
type: github
name: espressif/esp-idf
endpoint: nanoframework
ref: refs/tags/v4.4.4
jobs:
##############################
- job: Check_Build_Options
pool:
vmImage: 'windows-latest'
variables:
DOTNET_NOLOGO: true
steps:
- checkout: self
fetchDepth: 1
# get commit message
- powershell: |
if($env:StartReleaseCandidate -like "true")
{
# this is a release prep so NO build
echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]true"
Write-Host "Release preparation, skipping build."
}
else
{
# get commit details, if this is a PR
if($env:System_PullRequest_PullRequestId -ne $null)
{
Write-Host "**This is a PR build**"
$commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -ContentType "application/json" -Method GET
if( ($commit.commit.author.name -eq "nfbot") -and ($commit.commit.message -like "*[version update]*") )
{
echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]true"
}
else
{
echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]false"
}
}
else
{
Write-Host "**build for other reasons**"
echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]false"
}
}
name: BuildOptions
displayName: Get build options
# check what changed
- powershell: |
git config --global user.email "nfbot"
git config --global user.name "[email protected]"
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$(GitHubToken)")))"
if($env:StartReleaseCandidate -like "true")
{
# this is a release prep so NO build
}
else
{
if($env:System_PullRequest_PullRequestId -ne $null)
{
# get files changed in PR, if this is a PR
$commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/pulls/$env:System_PullRequest_PullRequestNumber/files" -Header @{"Authorization"="$auth"} -ContentType "application/json" -Method GET
# filter removed files
$files = $commit.where{$_.status -ne 'removed'}
}
else
{
# get files changed in the commit, if this is NOT a PR
$commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -Header @{"Authorization"="$auth"} -ContentType "application/json" -Method GET
# filter removed files
$files = $commit.files.where{$_.status -ne 'removed'}
}
# get file names only
$files = $files | % {$_.filename}
Write-host "Files changed:"
$files | % { Write-host $_ }
Write-host ""
# set default values
echo "##vso[task.setvariable variable=BUILD_CHIBIOS;isOutput=true]false"
echo "##vso[task.setvariable variable=BUILD_FREERTOS;isOutput=true]false"
echo "##vso[task.setvariable variable=BUILD_ESP32;isOutput=true]false"
echo "##vso[task.setvariable variable=BUILD_TI;isOutput=true]false"
echo "##vso[task.setvariable variable=BUILD_AZURERTOS;isOutput=true]false"
echo "##vso[task.setvariable variable=BUILD_WIN32;isOutput=true]false"
echo "##vso[task.setvariable variable=BUILD_NANOCLR_CLI;isOutput=true]false"
echo "##vso[task.setvariable variable=BUILD_ALL;isOutput=true]false"
if(
(($files.where{$_.Contains('/')}).Count -eq 0) -Or
(($files.where{$_.StartsWith('azure-pipelines-templates')}).Count -gt 0) -Or
(($files.where{$_.StartsWith('CMake')}).Count -gt 0) -Or
(($files.where{$_.StartsWith('src')}).Count -gt 0)
)
{
# files at:
# - repo root
# - azure-pipelines-templates
# - CMake
# - src
echo "##vso[task.setvariable variable=BUILD_ALL;isOutput=true]true"
Write-host "Building ALL targets"
}
if( ($files.where{$_.Contains('targets/ChibiOS')}).Count -gt 0)
{
# files at ChibiOS folder
echo "##vso[task.setvariable variable=BUILD_CHIBIOS;isOutput=true]true"
Write-host "Building ChibiOS targets"
}
if( ($files.where{$_.Contains('targets/FreeRTOS')}).Count -gt 0)
{
# files at FreeRTOS folder
echo "##vso[task.setvariable variable=BUILD_FREERTOS;isOutput=true]true"
Write-host "Building FreeRTOS targets"
}
if( ($files.where{$_.Contains('targets/ESP32')}).Count -gt 0)
{
# files at ESP32 folder
echo "##vso[task.setvariable variable=BUILD_ESP32;isOutput=true]true"
Write-host "Building ESP32 targets"
}
if( ($files.where{$_.Contains('targets/TI_SimpleLink')}).Count -gt 0)
{
# files at TI_SimpleLink folder
echo "##vso[task.setvariable variable=BUILD_TI;isOutput=true]true"
Write-host "Building TI SimpleLink targets"
}
if( ($files.where{$_.Contains('targets/AzureRTOS')}).Count -gt 0)
{
# files at AzureRTOS folder
echo "##vso[task.setvariable variable=BUILD_AZURERTOS;isOutput=true]true"
Write-host "Building Azure RTOS targets"
}
if(
(($files.where{$_.Contains('targets/netcore/nanoFramework.nanoCLR')}).Count -gt 0) -Or
(($files.where{$_.Contains('targets/netcore/nanoCLR.sln')}).Count -gt 0) -Or
(($files.where{$_.Contains('targets/win32')}).Count -gt 0)
)
{
# files at win32 or netcore folders
echo "##vso[task.setvariable variable=BUILD_WIN32;isOutput=true]true"
Write-host "Building nanoCLR target"
}
if(
(($files.where{$_.Contains('targets/netcore/nanoFramework.nanoCLR.CLI')}).Count -gt 0) -Or
(($files.where{$_.Contains('targets/netcore/nanoCLR.sln')}).Count -gt 0) -Or
(($files.where{$_.Contains('targets/netcore/nanoFramework.nanoCLR.Host')}).Count -gt 0)
)
{
# files at nanoCLR CLI or Host folders
echo "##vso[task.setvariable variable=BUILD_NANOCLR_CLI;isOutput=true]true"
Write-host "Building nanoCLR CLI target"
}
}
name: TargetsToBuild
displayName: Get targets to build
- task: DotNetCoreCLI@2
condition: eq( variables['StartReleaseCandidate'], true )
displayName: Install NBGV tool
inputs:
command: custom
custom: tool
arguments: install -g nbgv
- powershell: |
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
# 'encoded token' is the Base64 of the string "nfbot:personal-token"
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
cd "$env:Agent_TempDirectory" > $null
git init "$env:Agent_TempDirectory\repo"
cd repo > $null
git remote add origin "$env:Build_Repository_Uri"
git config --global gc.auto 0
git config --global user.name nfbot
git config --global user.email [email protected]
git config --global core.autocrlf true
git -c http.extraheader="AUTHORIZATION: $auth" fetch --progress origin
git checkout develop
# prepare release and capture output
$release = nbgv prepare-release
# push all changes to github
git -c http.extraheader="AUTHORIZATION: $auth" push --all origin
# get release branch name
$branch = $release.Split(' ')[0]
# start PR for release
$prRequestBody = @{title="Release $branch";body="";head="$branch";base="main"} | ConvertTo-Json
$githubApiEndpoint = "https://api.github.com/repos/$env:Build_Repository_Name/pulls"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$headers = @{}
$headers.Add("Authorization","$auth")
$headers.Add("Accept","application/vnd.github.symmetra-preview+json")
try
{
$result = Invoke-RestMethod -Method Post -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer -Uri $githubApiEndpoint -Header $headers -ContentType "application/json" -Body $prRequestBody
'Started PR for new release...' | Write-Host -NoNewline
'OK' | Write-Host -ForegroundColor Green
}
catch
{
$result = $_.Exception.Response.GetResponseStream()
$reader = New-Object System.IO.StreamReader($result)
$reader.BaseStream.Position = 0
$reader.DiscardBufferedData()
$responseBody = $reader.ReadToEnd();
"Error starting PR: $responseBody" | Write-Host -ForegroundColor Red
}
condition: eq( variables['StartReleaseCandidate'], true )
displayName: NBGV prepare release
##############################
- job: Check_Code_Style
condition: >-
and(
ne(dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true),
or(
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_CHIBIOS'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ESP32'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_FREERTOS'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_TI'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_AZURERTOS'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_WIN32'], true)
)
)
dependsOn:
- Check_Build_Options
pool:
vmImage: 'windows-latest'
steps:
- checkout: self
fetchDepth: 1
condition: ne(variables['System.PullRequest.PullRequestId'], '')
- template: azure-pipelines-templates/download-install-llvm.yml
- template: azure-pipelines-templates/check-code-style.yml
################
# STM32
- job: Build_STM32_targets
condition: >-
and(
succeeded('Check_Code_Style'),
ne( dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true ),
or(
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_CHIBIOS'], true)
)
)
dependsOn:
- Check_Build_Options
- Check_Code_Style
pool:
vmImage: 'windows-latest'
strategy:
matrix:
ST_STM32F429I_DISCOVERY:
TargetBoard: ST_STM32F429I_DISCOVERY
TargetSeries: 'stm32f4xx'
BuildOptions:
NeedsDFU: false
NeedsSRECORD: false
CMakePreset: ST_STM32F429I_DISCOVERY
ST_STM32F769I_DISCOVERY:
TargetBoard: ST_STM32F769I_DISCOVERY
TargetSeries: 'stm32f7xx'
BuildOptions:
NeedsDFU: false
NeedsSRECORD: true
CMakePreset: ST_STM32F769I_DISCOVERY
variables:
DOTNET_NOLOGO: true
# creates a counter and assigns it to the revision variable
REVISION: $[counter('STM32_1_8_1_versioncounter', 0)]
HelperPackageVersion: $[counter('HelperPackageVersioncounter', 0)]
GccArm_Version: ''
TargetPlatform: 'stm32'
steps:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/download-srecord.yml
- template: azure-pipelines-templates/download-hexdfu.yml
- template: azure-pipelines-templates/build-chibios-stm32-targets.yml
- template: azure-pipelines-templates/pack-publish-artifacts.yml
- template: azure-pipelines-templates/publish-cloudsmith.yml
- template: azure-pipelines-templates/pack-publish-managed-helpers.yml
#################
# ESP32 targets
- job: Build_ESP32_targets
condition: >-
and(
succeeded('Check_Code_Style'),
ne( dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true ),
or(
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ESP32'], true)
)
)
dependsOn:
- Check_Build_Options
- Check_Code_Style
pool:
vmImage: 'windows-latest'
# there is only a single ESP32 target, but this is already config as a matrix to make it easy to add new ones
strategy:
matrix:
ESP32_PSRAM_REV0:
TargetBoard: ESP32
TargetSeries: 'esp32'
BuildOptions:
IDF_Target: esp32
TargetName: ESP32
PackageName: ESP32_PSRAM_REV0
CMakePreset: ESP32_PSRAM_REV0
ESP32_BLE_REV0:
TargetBoard: ESP32
TargetSeries: 'esp32'
BuildOptions:
IDF_Target: esp32
TargetName: ESP32
PackageName: ESP32_BLE_REV0
CMakePreset: ESP32_BLE_REV0
ESP_WROVER_KIT:
TargetBoard: ESP32
TargetSeries: 'esp32'
BuildOptions:
IDF_Target: esp32
TargetName: ESP_WROVER_KIT
PackageName: ESP_WROVER_KIT
CMakePreset: ESP_WROVER_KIT
ESP32_LILYGO:
TargetBoard: ESP32
TargetSeries: 'esp32'
BuildOptions:
IDF_Target: esp32
TargetName: ESP32_LILYGO
PackageName: ESP32_LILYGO
CMakePreset: ESP32_LILYGO
FEATHER_S2:
TargetBoard: ESP32_S2
TargetSeries: 'esp32_s2'
BuildOptions:
IDF_Target: esp32s2
TargetName: FEATHER_S2
PackageName: FEATHER_S2
CMakePreset: FEATHER_S2
ESP32_C3:
TargetBoard: ESP32_C3
TargetSeries: 'esp32c3'
BuildOptions:
IDF_Target: esp32c3
TargetName: ESP32_C3
PackageName: ESP32_C3
CMakePreset: ESP32_C3
ESP32_S3:
TargetBoard: ESP32_S3
TargetSeries: 'esp32s3'
BuildOptions:
IDF_Target: esp32s3
TargetName: ESP32_S3
PackageName: ESP32_S3
CMakePreset: ESP32_S3
variables:
DOTNET_NOLOGO: true
# creates a counter and assigns it to the revision variable
REVISION: $[counter('ESP32_1_8_1_versioncounter', 0)]
IDF_PATH: 'D:/a/1/s/esp-idf'
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
TargetPlatform: 'esp32'
steps:
- checkout: self
- checkout: esp32_idf
fetchDepth: 1
- template: azure-pipelines-templates/build-preparations.yml
parameters:
repoDirectory: '$(Build.SourcesDirectory)\nf-interpreter'
- template: azure-pipelines-templates/nb-gitversioning.yml
parameters:
repoDirectory: '$(Build.SourcesDirectory)\nf-interpreter'
- template: azure-pipelines-templates/download-install-esp32-build-components.yml
- template: azure-pipelines-templates/download-install-ninja.yml
parameters:
repoDirectory: '$(Build.SourcesDirectory)\nf-interpreter'
- template: azure-pipelines-templates/build-espressif-esp32-targets.yml
- task: CopyFiles@2
condition: succeeded()
displayName: Copying bootloader
inputs:
sourceFolder: '$(Build.SourcesDirectory)\nf-interpreter\build\bootloader'
Contents: |
bootloader.bin
TargetFolder: '$(Build.ArtifactStagingDirectory)\$(TargetPublishName)'
flattenFolders: true
ignoreMakeDirErrors: true
- template: azure-pipelines-templates/copy-sdkconfig.yml
- template: azure-pipelines-templates/pack-publish-artifacts.yml
parameters:
buildDirectory: '$(Build.SourcesDirectory)\nf-interpreter\build'
- template: azure-pipelines-templates/publish-cloudsmith.yml
- template: azure-pipelines-templates/publish-sdkconfig.yml
#################
# NXP
- job: Build_NXP_targets
condition: >-
and(
succeeded('Check_Code_Style'),
ne( dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true ),
or(
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_FREERTOS'], true)
)
)
dependsOn:
- Check_Build_Options
- Check_Code_Style
pool:
vmImage: 'windows-latest'
strategy:
matrix:
NXP_MIMXRT1060_EVK:
TargetBoard: NXP_MIMXRT1060_EVK
TargetSeries: 'imxrt10xx'
BuildOptions:
GccArm_Version:
NeedsSRECORD: true
CMakePreset: NXP_MIMXRT1060_EVK
variables:
DOTNET_NOLOGO: true
# creates a counter and assigns it to the revision variable
REVISION: $[counter('NXP_1_8_1_versioncounter', 0)]
GIT_LFS_SKIP_SMUDGE: 1
TargetPlatform: 'freertos'
steps:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/download-srecord.yml
- template: azure-pipelines-templates/build-freertos-nxp-targets.yml
- template: azure-pipelines-templates/pack-publish-artifacts.yml
- template: azure-pipelines-templates/publish-cloudsmith.yml
- template: azure-pipelines-templates/pack-publish-managed-helpers.yml
#################
# TI SimpleLink
- job: Build_TI_SimpleLink_targets
condition: >-
and(
succeeded('Check_Code_Style'),
ne( dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true ),
or(
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_TI'], true)
)
)
dependsOn:
- Check_Build_Options
- Check_Code_Style
pool:
vmImage: 'windows-latest'
strategy:
matrix:
# disabled: waiting to update SDK to latest version with Sys Config
# TI_CC3220SF_LAUNCHXL:
# TargetBoard: TI_CC3220SF_LAUNCHXL
# TargetSeries: 'cc32xx'
# BuildOptions: >-
# -DTARGET_SERIES=CC32xx
# -DRTOS=TI_SimpleLink
# -DSUPPORT_ANY_BASE_CONVERSION=OFF
# -DNF_FEATURE_DEBUGGER=ON
# -DNF_FEATURE_RTC=ON
# -DNF_FEATURE_WATCHDOG=OFF
# -DNF_FEATURE_HAS_CONFIG_BLOCK=ON
# -DAPI_System.Device.Gpio=ON
# -DAPI_System.Device.Spi=ON
# -DAPI_System.Device.I2c=ON
# -DAPI_System.Device.Pwm=ON
# -DAPI_System.Device.Adc=ON
# -DAPI_System.Net=ON
# -DAPI_nanoFramework.System.Collections=ON
# -DAPI_nanoFramework.System.Text=ON
# GccArm_Version:
TI_CC1352R1_LAUNCHXL_915:
TargetBoard: TI_CC1352R1_LAUNCHXL
PackageName: TI_CC1352R1_LAUNCHXL_915
TargetSeries: 'CC13X2'
BuildOptions: >-
-DRADIO_FREQUENCY=915
GccArm_Version:
CMakePreset: TI_CC1352R1_LAUNCHXL
variables:
DOTNET_NOLOGO: true
# creates a counter and assigns it to the revision variable
REVISION: $[counter('TI_1_8_1_versioncounter', 0)]
HelperPackageVersion: $[counter('HelperPackageVersioncounter', 0)]
TargetPlatform: 'ti_simplelink'
steps:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/build-ti-simplelink-targets.yml
- template: azure-pipelines-templates/pack-publish-artifacts.yml
- template: azure-pipelines-templates/publish-cloudsmith.yml
- template: azure-pipelines-templates/pack-publish-ti-sl-managed-helpers.yml
#################
# Azure RTOS
- job: Build_Azure_RTOS_targets
condition: >-
and(
succeeded('Check_Code_Style'),
ne( dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true ),
or(
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_AZURERTOS'], true)
)
)
dependsOn:
- Check_Build_Options
- Check_Code_Style
pool:
vmImage: 'windows-latest'
strategy:
matrix:
ST_B_L475E_IOT01A:
TargetBoard: ST_B_L475E_IOT01A
TargetSeries: 'stm32l4xx'
BuildOptions:
GccArm_Version:
NeedsDFU: true
NeedsSRECORD: false
CMakePreset: ST_B_L475E_IOT01A
# ORGPAL_PALTHREE:
# TargetBoard: ORGPAL_PALTHREE
# TargetSeries: 'stm32f7xx'
# BuildOptions:
# GccArm_Version:
# NeedsDFU: true
# NeedsSRECORD: false
# CMakePreset: ORGPAL_PALTHREE
SL_STK3701A:
TargetBoard: SL_STK3701A
TargetSeries: 'efm32gg11'
BuildOptions:
GccArm_Version:
NeedsDFU: false
NeedsSRECORD: false
CMakePreset: SL_STK3701A
variables:
# creates a counter and assigns it to the revision variable
REVISION: $[counter('AZURERTOS_1_8_1_versioncounter', 0)]
HelperPackageVersion: $[counter('HelperPackageVersioncounter', 0)]
TargetPlatform: 'azure_rtos'
steps:
- template: azure-pipelines-templates/build-preparations.yml
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/download-install-arm-gcc-toolchain.yml
- template: azure-pipelines-templates/download-install-ninja.yml
- template: azure-pipelines-templates/download-hexdfu.yml
- template: azure-pipelines-templates/download-srecord.yml
- template: azure-pipelines-templates/build-azurertos-targets.yml
- template: azure-pipelines-templates/pack-publish-artifacts.yml
- template: azure-pipelines-templates/publish-cloudsmith.yml
- template: azure-pipelines-templates/pack-publish-managed-helpers.yml
#################
# WIN32 executable
- job: Build_WIN32_nanoCLR
condition: >-
and(
succeeded('Check_Code_Style'),
ne( dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true ),
or(
eq(variables['BUILD_WINDOWS_NANOCLR__'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_WIN32'], true)
)
)
dependsOn:
- Check_Build_Options
- Check_Code_Style
pool:
vmImage: 'windows-latest'
variables:
DOTNET_NOLOGO: true
# creates a counter and assigns it to the revision variable
REVISION: $[counter('WIN32_1_8_1_versioncounter', 0)]
steps:
- template: azure-pipelines-templates/nb-gitversioning.yml
- task: PowerShell@2
displayName: Store package version
inputs:
targetType: 'inline'
script: |
Write-Host "$("##vso[task.setvariable variable=WINCLR_PACKAGE_VERSION]")$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER)"
Write-Host "$("##vso[task.setvariable variable=WINCLR_AssemblyInformationalVersion]")$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER)$(NBGV_BuildMetadataFragment)"
- template: azure-pipelines-templates/install-nuget.yml@templates
- task: UseDotNet@2
displayName: Install .NET SDK
inputs:
packageType: sdk
version: 6.x
performMultiLevelLookup: true
- task: DotNetCoreCLI@2
displayName: Restore NuGet packages
inputs:
command: restore
restoreArguments: '--locked-mode'
verbosityRestore: minimal
projects: targets\netcore\nanoCLR.sln
feedsToUse: select
includeNuGetOrg: true
- task: VSBuild@1
displayName: Build WIN32 EXE target
inputs:
solution: 'targets\win32\nanoCLR.sln'
platform: 'x86'
maximumCpuCount: true
msbuildArgs: '/p:PublicRelease=true'
configuration: 'Release'
- task: VSBuild@1
displayName: Build WIN DLL target
inputs:
solution: 'targets\netcore\nanoCLR.sln'
platform: 'Any CPU'
maximumCpuCount: true
msbuildArgs: '/p:PublicRelease=true'
configuration: 'Release'
- task: DotNetCoreCLI@2
displayName: Install SignTool tool
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], '')
)
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Build.Repository.LocalPath)\build\bin\Release" `
--input "**/nanoFramework.nanoCLR.*" `
--config "$(Build.Repository.LocalPath)\config\SignClient.json" `
--filelist "$(Build.Repository.LocalPath)\config\filelist.txt" `
--user "$(SignClientUser)" `
--secret '$(SignClientSecret)' `
--name "nanoFramework.nanoCLR" `
--description "nanoFramework.nanoCLR" `
--descriptionUrl "https://github.com/$env:Build_Repository_Name"
displayName: Sign nanoCLR assemblies
continueOnError: true
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], '')
)
- task: NuGetCommand@2
condition: >-
and(
succeeded(),
startsWith(variables['Build.SourceBranchName'], 'main')
)
displayName: Pack nanoCLR WIN32 (stable)
inputs:
command: 'custom'
arguments: 'pack targets\win32\nanoFramework.nanoCLR.Win32.nuspec -Version $(NBGV_NuGetPackageVersion).$(TARGET_BUILD_COUNTER)'
- task: NuGetCommand@2
condition: >-
and(
succeeded(),
or(
startsWith(variables['Build.SourceBranchName'], 'develop'),
startsWith(variables['Build.SourceBranchName'], 'release')
)
)
displayName: Pack nanoCLR WIN32 (preview)
inputs:
command: 'custom'
arguments: 'pack targets\win32\nanoFramework.nanoCLR.Win32.nuspec -Version $(NBGV_NuGetPackageVersion)'
- task: CopyFiles@2
condition: succeeded()
displayName: Collecting NuGet packages
inputs:
sourceFolder: $(Build.SourcesDirectory)
Contents: |
**\nanoFramework.nanoCLR.Win32*.nupkg
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
ignoreMakeDirErrors: true
- task: CopyFiles@2
condition: succeeded()
displayName: Adding nanoCLR WIN32 to deployable artifacts
inputs:
sourceFolder: $(Build.SourcesDirectory)
Contents: |
**\nanoFramework.nanoCLR.exe
TargetFolder: '$(Build.ArtifactStagingDirectory)\WIN32_nanoCLR'
flattenFolders: true
ignoreMakeDirErrors: true
- task: CopyFiles@2
condition: succeeded()
displayName: Adding nanoCLR DLL to deployable artifacts
inputs:
sourceFolder: $(Build.SourcesDirectory)
Contents: |
**\nanoFramework.nanoCLR.dll
TargetFolder: '$(Build.ArtifactStagingDirectory)\WIN_DLL_nanoCLR'
flattenFolders: true
ignoreMakeDirErrors: true
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Build.ArtifactStagingDirectory)" `
--input "**/*.nupkg" `
--config "$(Build.Repository.LocalPath)\config\SignClient.json" `
--filelist "$(Build.Repository.LocalPath)\config\filelist.txt" `
--user "$(SignClientUser)" `
--secret '$(SignClientSecret)' `
--name "nanoFramework.nanoCLR NuGets" `
--description "nanoFramework.nanoCLR NuGets" `
--descriptionUrl "https://github.com/$env:Build_Repository_Name"
displayName: Sign packages
continueOnError: true
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], '')
)
# publish artifacts
- task: PublishBuildArtifacts@1
condition: succeeded()
displayName: Publish deployables artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: deployables
ArtifactType: Container
# push NuGet packages to Azure Artifacts feed (always happens when building from main, except on PR builds)
- task: NuGetCommand@2
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], ''),
or(
eq(variables['ForceUpload'], true),
eq(variables['Build.SourceBranchName'], 'main')
)
)
continueOnError: true
displayName: Push NuGet packages to Azure Artifacts
inputs:
command: push
nuGetFeedType: external
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
publishFeedCredentials: 'AzureArtifacts-nf-interpreter'
allowPackageConflicts: true
# push NuGet packages to NuGet (always happens when building from main, except on PR builds)
- task: NuGetCommand@2
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], ''),
or(
eq(variables['ForceUpload'], true),
eq(variables['Build.SourceBranchName'], 'main')
)
)
continueOnError: true
displayName: Push NuGet packages to NuGet
inputs:
command: push
nuGetFeedType: external
allowPackageConflicts: true
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
publishFeedCredentials: 'NuGet-nf-interpreter'
- template: azure-pipelines-templates/publish-nanoclr.yml
#################
# nanoCLR CLI tool
- job: Build_nanoCLR_CLI
condition: >-
and(
succeeded('Check_Code_Style'),
ne(dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true),
or(
eq(variables['BUILD_NANOCLR_CLI__'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_NANOCLR_CLI'], true)
)
)
dependsOn:
- Check_Build_Options
- Check_Code_Style
pool:
vmImage: 'windows-latest'
variables:
DOTNET_NOLOGO: true
steps:
- template: azure-pipelines-templates/nb-gitversioning.yml
- template: azure-pipelines-templates/install-nuget.yml@templates
- task: UseDotNet@2
displayName: Install .NET SDK
inputs:
packageType: sdk
version: 6.x
performMultiLevelLookup: true
- task: DotNetCoreCLI@2
displayName: Restore NuGet packages
inputs:
command: restore
verbosityRestore: minimal
projects: targets\netcore\nanoCLR.sln
feedsToUse: select
includeNuGetOrg: true
- task: VSBuild@1
displayName: Build .NET tool
condition: succeeded()
inputs:
solution: 'targets\netcore\nanoCLR.sln'
platform: 'Any CPU'
maximumCpuCount: true
msbuildArgs: '/p:PublicRelease=true'
configuration: 'Release'
- task: DotNetCoreCLI@2
displayName: Install SignTool tool
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], '')
)
inputs:
command: custom