7070
7171 # get commit message
7272 - powershell : |
73+ git config --global user.email "nfbot"
74+ git config --global user.name "nanoframework@outlook.com"
75+
76+ $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$(GitHubToken)")))"
7377
7478 # set default values
7579 echo "##vso[task.setvariable variable=RUN_MSCORLIB_TESTS;isOutput=true]false"
9296 # 'encoded token' is the Base64 of the string "nfbot:personal-token"
9397 $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
9498
95- $commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -ContentType "application/json" -Method GET
99+ $commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -Header @{"Authorization"="$auth"} - ContentType "application/json" -Method GET
96100
97101 if( ($commit.commit.author.name -eq "nfbot") -and ($commit.commit.message -like "*[version update]*") )
98102 {
@@ -1335,109 +1339,6 @@ jobs:
13351339 artifactName : VsTestCrashDumps
13361340 artifactType : pipeline
13371341
1338- # #####################
1339- # generate change log
1340- - job : Generate_change_log
1341- dependsOn :
1342- - Build_STM32_targets
1343- - Build_ESP32_targets
1344- - Build_NXP_targets
1345- - Build_TI_SimpleLink_targets
1346- - Build_Azure_RTOS_targets
1347- # skip build if this is a PR, submitted by nfbot and the commit message contains [version update]
1348- condition : >-
1349- and(
1350- succeeded('Build_STM32_targets'),
1351- succeeded('Build_ESP32_targets'),
1352- succeeded('Build_NXP_targets'),
1353- succeeded('Build_TI_SimpleLink_targets'),
1354- succeeded('Build_Azure_RTOS_targets'),
1355- not( eq(variables['Build.Reason'], 'PullRequest')
1356- ),
1357- or(
1358- eq(variables['Build.SourceBranchName'], 'main'),
1359- startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ),
1360- ne( variables['StartReleaseCandidate'], true )
1361- )
1362-
1363- pool :
1364- vmImage : " windows-latest"
1365-
1366- steps :
1367- - task : DotNetCoreCLI@2
1368- condition : succeeded()
1369- displayName : Install NBGV tool
1370- inputs :
1371- command : custom
1372- custom : tool
1373- arguments : install --tool-path . nbgv
1374-
1375- - script : nbgv cloud -a -c
1376- condition : succeeded()
1377- displayName : Set build number
1378-
1379- - task : UseRubyVersion@0
1380- condition : succeeded()
1381- inputs :
1382- versionSpec : " = 3.0"
1383- addToPath : true
1384-
1385- # Cache change log cache files
1386- - task : Cache@2
1387- displayName : Cache change log cache files
1388- condition : >-
1389- and(
1390- succeeded(),
1391- eq(variables['System.PullRequest.PullRequestId'], ''),
1392- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1393- )
1394- inputs :
1395- key : " changeLogCacheFiles"
1396- restoreKeys : 1_0
1397- path : |
1398- $(Agent.TempDirectory)/github-changelog-logger.log
1399- $(Agent.TempDirectory)/github-changelog-http-cache
1400-
1401- # generate change log including future version
1402- - powershell : |
1403- gem install github_changelog_generator --quiet --no-document
1404- # need to call it passing both cache options with full path otherwise it won't work
1405- github_changelog_generator --token $(GitHubToken) --cache-log $env:AGENT_TEMPDIRECTORY\github-changelog-logger.log --cache-file $env:AGENT_TEMPDIRECTORY\github-changelog-http-cache --pr-wo-labels --future-release "v$env:NBGV_AssemblyVersion"
1406- condition: >-
1407- and(
1408- succeeded(),
1409- eq(variables['System.PullRequest.PullRequestId'], ''),
1410- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1411- )
1412- displayName: Generate change log
1413-
1414- # push new changelog to GitHub repo
1415- - powershell : |
1416- git config --global gc.auto 0
1417- git config --global user.name nfbot
1418- git config --global user.email nanoframework@outlook.com
1419- git config --global core.autocrlf true
1420-
1421- git add CHANGELOG.md
1422- git commit -m "Update CHANGELOG" -m"***NO_CI***"
1423-
1424- # compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
1425- # 'encoded token' is the Base64 of the string "nfbot:personal-token"
1426- $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
1427-
1428- git -c http.extraheader="AUTHORIZATION: $auth" push origin "HEAD:$(Build.SourceBranchName)"
1429- condition: >-
1430- and(
1431- succeeded(),
1432- eq(variables['System.PullRequest.PullRequestId'], ''),
1433- not(
1434- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1435- ),
1436- eq( variables['StartReleaseCandidate'], false )
1437- )
1438- continueOnError: true
1439- displayName: Push changelog to GitHub
1440-
14411342 # ################################
14421343 # report build failure to Discord
14431344 - job : Report_Build_Failure
@@ -1449,7 +1350,6 @@ jobs:
14491350 - Build_Azure_RTOS_targets
14501351 - Build_WIN32_nanoCLR
14511352 - Build_nanoCLR_CLI
1452- - Generate_change_log
14531353 - Check_Code_Style
14541354 condition : >-
14551355 and(
@@ -1461,8 +1361,7 @@ jobs:
14611361 failed('Build_TI_SimpleLink_targets'),
14621362 failed('Build_Azure_RTOS_targets'),
14631363 failed('Build_WIN32_nanoCLR'),
1464- failed('Build_nanoCLR_CLI'),
1465- failed('Generate_change_log')
1364+ failed('Build_nanoCLR_CLI')
14661365 )
14671366 )
14681367
0 commit comments