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 {
@@ -1347,109 +1351,6 @@ jobs:
13471351 artifactName : VsTestCrashDumps
13481352 artifactType : pipeline
13491353
1350- # #####################
1351- # generate change log
1352- - job : Generate_change_log
1353- dependsOn :
1354- - Build_STM32_targets
1355- - Build_ESP32_targets
1356- - Build_NXP_targets
1357- - Build_TI_SimpleLink_targets
1358- - Build_Azure_RTOS_targets
1359- # skip build if this is a PR, submitted by nfbot and the commit message contains [version update]
1360- condition : >-
1361- and(
1362- succeeded('Build_STM32_targets'),
1363- succeeded('Build_ESP32_targets'),
1364- succeeded('Build_NXP_targets'),
1365- succeeded('Build_TI_SimpleLink_targets'),
1366- succeeded('Build_Azure_RTOS_targets'),
1367- not( eq(variables['Build.Reason'], 'PullRequest')
1368- ),
1369- or(
1370- eq(variables['Build.SourceBranchName'], 'main'),
1371- startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ),
1372- ne( variables['StartReleaseCandidate'], true )
1373- )
1374-
1375- pool :
1376- vmImage : " windows-latest"
1377-
1378- steps :
1379- - task : DotNetCoreCLI@2
1380- condition : succeeded()
1381- displayName : Install NBGV tool
1382- inputs :
1383- command : custom
1384- custom : tool
1385- arguments : install --tool-path . nbgv
1386-
1387- - script : nbgv cloud -a -c
1388- condition : succeeded()
1389- displayName : Set build number
1390-
1391- - task : UseRubyVersion@0
1392- condition : succeeded()
1393- inputs :
1394- versionSpec : " = 3.0"
1395- addToPath : true
1396-
1397- # Cache change log cache files
1398- - task : Cache@2
1399- displayName : Cache change log cache files
1400- condition : >-
1401- and(
1402- succeeded(),
1403- eq(variables['System.PullRequest.PullRequestId'], ''),
1404- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1405- )
1406- inputs :
1407- key : " changeLogCacheFiles"
1408- restoreKeys : 1_0
1409- path : |
1410- $(Agent.TempDirectory)/github-changelog-logger.log
1411- $(Agent.TempDirectory)/github-changelog-http-cache
1412-
1413- # generate change log including future version
1414- - powershell : |
1415- gem install github_changelog_generator --quiet --no-document
1416- # need to call it passing both cache options with full path otherwise it won't work
1417- 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"
1418- condition: >-
1419- and(
1420- succeeded(),
1421- eq(variables['System.PullRequest.PullRequestId'], ''),
1422- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1423- )
1424- displayName: Generate change log
1425-
1426- # push new changelog to GitHub repo
1427- - powershell : |
1428- git config --global gc.auto 0
1429- git config --global user.name nfbot
1430- git config --global user.email [email protected] 1431- git config --global core.autocrlf true
1432-
1433- git add CHANGELOG.md
1434- git commit -m "Update CHANGELOG" -m"***NO_CI***"
1435-
1436- # compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
1437- # 'encoded token' is the Base64 of the string "nfbot:personal-token"
1438- $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
1439-
1440- git -c http.extraheader="AUTHORIZATION: $auth" push origin "HEAD:$(Build.SourceBranchName)"
1441- condition: >-
1442- and(
1443- succeeded(),
1444- eq(variables['System.PullRequest.PullRequestId'], ''),
1445- not(
1446- startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
1447- ),
1448- eq( variables['StartReleaseCandidate'], false )
1449- )
1450- continueOnError: true
1451- displayName: Push changelog to GitHub
1452-
14531354 # ################################
14541355 # report build failure to Discord
14551356 - job : Report_Build_Failure
@@ -1461,7 +1362,6 @@ jobs:
14611362 - Build_Azure_RTOS_targets
14621363 - Build_WIN32_nanoCLR
14631364 - Build_nanoCLR_CLI
1464- - Generate_change_log
14651365 - Check_Code_Style
14661366 condition : >-
14671367 and(
@@ -1473,8 +1373,7 @@ jobs:
14731373 failed('Build_TI_SimpleLink_targets'),
14741374 failed('Build_Azure_RTOS_targets'),
14751375 failed('Build_WIN32_nanoCLR'),
1476- failed('Build_nanoCLR_CLI'),
1477- failed('Generate_change_log')
1376+ failed('Build_nanoCLR_CLI')
14781377 )
14791378 )
14801379
0 commit comments