7070
7171 # get commit message
7272 - powershell : |
73+ git config --global user.email "nfbot"
74+ git config --global user.name "[email protected] " 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"
8892 {
8993 Write-Host "##[command] **This is a PR build**"
9094
91- $commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -ContentType "application/json" -Method GET
95+ $commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -Header @{"Authorization"="$auth"} - ContentType "application/json" -Method GET
9296
9397 if( ($commit.commit.author.name -eq "nfbot") -and ($commit.commit.message -like "*[version update]*") )
9498 {
@@ -1353,109 +1357,6 @@ jobs:
13531357 artifactName : VsTestCrashDumps
13541358 artifactType : pipeline
13551359
1356- # #####################
1357- # generate change log
1358- - job : Generate_change_log
1359- dependsOn :
1360- - Build_STM32_targets
1361- - Build_ESP32_targets
1362- - Build_NXP_targets
1363- - Build_TI_SimpleLink_targets
1364- - Build_Azure_RTOS_targets
1365- # skip build if this is a PR, submitted by nfbot and the commit message contains [version update]
1366- condition : >-
1367- and(
1368- succeeded('Build_STM32_targets'),
1369- succeeded('Build_ESP32_targets'),
1370- succeeded('Build_NXP_targets'),
1371- succeeded('Build_TI_SimpleLink_targets'),
1372- succeeded('Build_Azure_RTOS_targets'),
1373- not( eq(variables['Build.Reason'], 'PullRequest')
1374- ),
1375- or(
1376- eq(variables['Build.SourceBranchName'], 'main'),
1377- startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ),
1378- ne( variables['StartReleaseCandidate'], true )
1379- )
1380-
1381- pool :
1382- vmImage : " windows-latest"
1383-
1384- steps :
1385- - task : DotNetCoreCLI@2
1386- condition : succeeded()
1387- displayName : Install NBGV tool
1388- inputs :
1389- command : custom
1390- custom : tool
1391- arguments : install --tool-path . nbgv
1392-
1393- - script : nbgv cloud -a -c
1394- condition : succeeded()
1395- displayName : Set build number
1396-
1397- - task : UseRubyVersion@0
1398- condition : succeeded()
1399- inputs :
1400- versionSpec : " = 3.0"
1401- addToPath : true
1402-
1403- # Cache change log cache files
1404- - task : Cache@2
1405- displayName : Cache change log cache files
1406- condition : >-
1407- and(
1408- succeeded(),
1409- eq(variables['System.PullRequest.PullRequestId'], ''),
1410- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1411- )
1412- inputs :
1413- key : " changeLogCacheFiles"
1414- restoreKeys : 1_0
1415- path : |
1416- $(Agent.TempDirectory)/github-changelog-logger.log
1417- $(Agent.TempDirectory)/github-changelog-http-cache
1418-
1419- # generate change log including future version
1420- - powershell : |
1421- gem install github_changelog_generator --quiet --no-document
1422- # need to call it passing both cache options with full path otherwise it won't work
1423- 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"
1424- condition: >-
1425- and(
1426- succeeded(),
1427- eq(variables['System.PullRequest.PullRequestId'], ''),
1428- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1429- )
1430- displayName: Generate change log
1431-
1432- # push new changelog to GitHub repo
1433- - powershell : |
1434- git config --global gc.auto 0
1435- git config --global user.name nfbot
1436- git config --global user.email [email protected] 1437- git config --global core.autocrlf true
1438-
1439- git add CHANGELOG.md
1440- git commit -m "Update CHANGELOG" -m"***NO_CI***"
1441-
1442- # compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
1443- # 'encoded token' is the Base64 of the string "nfbot:personal-token"
1444- $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
1445-
1446- git -c http.extraheader="AUTHORIZATION: $auth" push origin "HEAD:$(Build.SourceBranchName)"
1447- condition: >-
1448- and(
1449- succeeded(),
1450- eq(variables['System.PullRequest.PullRequestId'], ''),
1451- not(
1452- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1453- ),
1454- eq( variables['StartReleaseCandidate'], false )
1455- )
1456- continueOnError: true
1457- displayName: Push changelog to GitHub
1458-
14591360 # ################################
14601361 # report build failure to Discord
14611362 - job : Report_Build_Failure
@@ -1467,7 +1368,6 @@ jobs:
14671368 - Build_Azure_RTOS_targets
14681369 - Build_WIN32_nanoCLR
14691370 - Build_nanoCLR_CLI
1470- - Generate_change_log
14711371 - Check_Code_Style
14721372 condition : >-
14731373 and(
@@ -1479,8 +1379,7 @@ jobs:
14791379 failed('Build_TI_SimpleLink_targets'),
14801380 failed('Build_Azure_RTOS_targets'),
14811381 failed('Build_WIN32_nanoCLR'),
1482- failed('Build_nanoCLR_CLI'),
1483- failed('Generate_change_log')
1382+ failed('Build_nanoCLR_CLI')
14841383 )
14851384 )
14861385
0 commit comments