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