Skip to content

Commit d2b908e

Browse files
committed
Work CI-CD
- Fix task to download nanclr artifact for unit tests. - GitHub auth now uses token directly. - Fix condition for pre-release on develop branch. ***NO_CI***
1 parent 5d24cd3 commit d2b908e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

azure-pipelines-templates/check-nf-interpreter-to-test.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ steps:
1010
targetType: "inline"
1111
script: |
1212
13-
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
14-
# 'encoded token' is the Base64 of the string "nfbot:personal-token"
15-
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
13+
# prepare GitHub API headers using token auth
14+
$headers = @{
15+
Authorization = "token $env:GITHUB_TOKEN"
16+
'User-Agent' = 'azure-pipelines'
17+
Accept = 'application/vnd.github+json'
18+
}
1619
1720
# find PR
1821
"Getting PR #$env:System_PullRequest_PullRequestNumber details..." | Write-Host -ForegroundColor White -NoNewline
19-
$pr = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:Build_Repository_Name/pulls/$env:System_PullRequest_PullRequestNumber" -Header @{"Authorization"="$auth"} -ContentType "application/json" -Method GET
22+
$pr = Invoke-RestMethod `
23+
-Uri "https://api.github.com/repos/$env:Build_Repository_Name/pulls/$env:System_PullRequest_PullRequestNumber" `
24+
-Headers $headers `
25+
-Method GET
2026
2127
if($($pr.number) -eq "$env:System_PullRequest_PullRequestNumber")
2228
{
@@ -56,7 +62,7 @@ steps:
5662
definition: '34'
5763
buildVersionToDownload: specific
5864
allowFailedBuilds: true
59-
pipelineId: $(NFINTERPRETER_BUILDID)
65+
buildId: $(NFINTERPRETER_BUILDID)
6066
artifactName: 'nanoclr_cli'
6167
targetPath: '$(Pipeline.Workspace)/nanoclr'
6268

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
releaseNotesInline: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).<br><br><h4>Install from NuGet</h4><br>The following NuGet packages are available for download from this release:<br>:package: [.NET](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).<br>:package: [.NET (without Reflection)](https://www.nuget.org/packages/$(nugetPackageName).NoReflection/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
149149
assets: '$(Build.ArtifactStagingDirectory)/*.nupkg'
150150
assetUploadMode: replace
151-
isPreRelease: false
151+
isPreRelease: $[eq(variables['Build.SourceBranchName'], 'develop')]
152152
addChangeLog: false
153153

154154
##############################

0 commit comments

Comments
 (0)