@@ -78,34 +78,60 @@ jobs:
78
78
{
79
79
# this is a release prep so NO build
80
80
echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]true"
81
-
81
+
82
82
Write-Host "##[command] Release preparation, skipping build."
83
83
}
84
84
else
85
85
{
86
86
# get commit details, if this is a PR
87
87
if($env:System_PullRequest_PullRequestId -ne $null)
88
88
{
89
- Write-Host "##[command] **This is a PR build**"
89
+ Write-Host "**This is a PR build**"
90
+
91
+ # compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
92
+ # 'encoded token' is the Base64 of the string "nfbot:personal-token"
93
+ $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
90
94
91
95
$commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -ContentType "application/json" -Method GET
92
96
93
97
if( ($commit.commit.author.name -eq "nfbot") -and ($commit.commit.message -like "*[version update]*") )
94
98
{
95
- Write-Host "##[command] **version update commit, skipping build**"
96
- echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]true"
99
+ Write-Host "**version update commit, skipping build**"
100
+ echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]true"
97
101
}
98
102
else
99
103
{
100
- echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]false"
104
+ echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]false"
101
105
}
102
106
107
+ # find PR
108
+ "Getting PR #$env:System_PullRequest_PullRequestNumber details..." | Write-Host -ForegroundColor White -NoNewline
109
+ $pr = Invoke-WebRequest "https://api.github.com/repos/$env:Build_Repository_Name/pulls/$env:System_PullRequest_PullRequestNumber" | ConvertFrom-Json
110
+
111
+ if($($pr.number) -eq "$env:System_PullRequest_PullRequestNumber")
112
+ {
113
+ 'OK' | Write-Host -ForegroundColor Green
114
+ }
115
+
116
+ # grab PR commit message
117
+ $prCommitMessage = $($pr.body)
118
+
119
+ # debug output
120
+ # echo "=====`r`n$($prCommitMessage)`r`n====="
121
+
103
122
# check if Unit Tests for mscorlib should be run
104
- if(($commit.commit.message -like "*[run mscorlib tests]*") -or ($commit.commit.message -match "Tested against nanoframework/CoreLibrary#(\d+)"))
123
+ if(($prCommitMessage -like "*[run mscorlib tests]*") -or ($prCommitMessage -match "Tested against nanoframework/CoreLibrary#(\d+)"))
105
124
{
106
- Write-Host "##[command] ** mscorlib tests are to be runned** "
125
+ Write-Host "##[command] >> mscorlib tests are to be run "
107
126
echo "##vso[task.setvariable variable=RUN_MSCORLIB_TESTS;isOutput=true]true"
108
127
}
128
+
129
+ # check if should use specific MDP for mscorlib
130
+ if($prCommitMessage -match "\[build with MDP buildId (\d+)\]")
131
+ {
132
+ Write-Host "##[command] >> Using specific MDP for mscorlib build"
133
+ echo "##vso[task.setvariable variable=USE_SPECIFIC_MDP;isOutput=true]true"
134
+ }
109
135
}
110
136
else
111
137
{
@@ -409,7 +435,7 @@ jobs:
409
435
variables :
410
436
DOTNET_NOLOGO : true
411
437
# creates a counter and assigns it to the revision variable
412
- REVISION : $[counter('STM32_1_12_4_versioncounter ', 0)]
438
+ REVISION : $[counter('STM32_2_0_0_versioncounter ', 0)]
413
439
HelperPackageVersion : $[counter('HelperPackageVersioncounter', 0)]
414
440
TargetPlatform : " stm32"
415
441
@@ -524,7 +550,7 @@ jobs:
524
550
variables :
525
551
DOTNET_NOLOGO : true
526
552
# creates a counter and assigns it to the revision variable
527
- REVISION : $[counter('ESP32_1_12_4_versioncounter ', 0)]
553
+ REVISION : $[counter('ESP32_2_0_0_versioncounter ', 0)]
528
554
IDF_PATH : " D:/a/1/s/esp-idf"
529
555
PIP_CACHE_DIR : $(Pipeline.Workspace)/.pip
530
556
TargetPlatform : " esp32"
@@ -612,7 +638,7 @@ jobs:
612
638
variables :
613
639
DOTNET_NOLOGO : true
614
640
# creates a counter and assigns it to the revision variable
615
- REVISION : $[counter('NXP_1_12_4_versioncounter ', 0)]
641
+ REVISION : $[counter('NXP_2_0_0_versioncounter ', 0)]
616
642
GIT_LFS_SKIP_SMUDGE : 1
617
643
TargetPlatform : " freertos"
618
644
@@ -691,7 +717,7 @@ jobs:
691
717
variables :
692
718
DOTNET_NOLOGO : true
693
719
# creates a counter and assigns it to the revision variable
694
- REVISION : $[counter('TI_1_12_4_versioncounter ', 0)]
720
+ REVISION : $[counter('TI_2_0_0_versioncounter ', 0)]
695
721
HelperPackageVersion : $[counter('HelperPackageVersioncounter', 0)]
696
722
TargetPlatform : " ti_simplelink"
697
723
@@ -763,7 +789,7 @@ jobs:
763
789
764
790
variables :
765
791
# creates a counter and assigns it to the revision variable
766
- REVISION : $[counter('AZURERTOS_1_12_4_versioncounter ', 0)]
792
+ REVISION : $[counter('AZURERTOS_2_0_0_versioncounter ', 0)]
767
793
HelperPackageVersion : $[counter('HelperPackageVersioncounter', 0)]
768
794
TargetPlatform : " efm32"
769
795
@@ -815,7 +841,7 @@ jobs:
815
841
value : true
816
842
# creates a counter and assigns it to the revision variable
817
843
- name : REVISION
818
- value : $[counter('WIN32_1_12_4_versioncounter ', 0)]
844
+ value : $[counter('WIN32_2_0_0_versioncounter ', 0)]
819
845
- name : LITTLEFS_PATH
820
846
value : " D:/a/1/s/littlefs"
821
847
@@ -1237,6 +1263,7 @@ jobs:
1237
1263
1238
1264
dependsOn :
1239
1265
- Build_nanoCLR_CLI
1266
+ - Check_Build_Options
1240
1267
1241
1268
pool :
1242
1269
vmImage : " windows-latest"
@@ -1246,6 +1273,7 @@ jobs:
1246
1273
solution : " nanoFramework.CoreLibrary.sln"
1247
1274
buildPlatform : " Any CPU"
1248
1275
buildConfiguration : " Release"
1276
+ DownloadMDP : $[ dependencies.Check_Build_Options.outputs['BuildOptions.USE_SPECIFIC_MDP'] ]
1249
1277
1250
1278
steps :
1251
1279
- checkout : self
@@ -1271,6 +1299,9 @@ jobs:
1271
1299
displayName : Install .NET nanoFramework MSBuild components
1272
1300
inputs :
1273
1301
GitHubToken : $(GitHubToken)
1302
+ UsePreview : true
1303
+
1304
+ - template : azure-pipelines-templates/check-mdp-for-build.yml
1274
1305
1275
1306
- template : azure-pipelines-templates/install-nuget.yml@templates
1276
1307
0 commit comments