Skip to content

Commit f13bad6

Browse files
committed
Work CD-CI
- Update condition to check for PR build. ***NO_CI***
1 parent 96f858f commit f13bad6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
$MyNuGetVersion = $env:NBGV_NuGetPackageVersion -replace "\-g$env:NBGV_GitCommitIdShort", ""
181181
182182
# replace preview with alpha if this is a PR build
183-
if($env:Build_Reason -eq 'PullRequest')
183+
if($env:System_PullRequest_PullRequestId -ne '')
184184
{
185185
$MyNuGetVersion = $MyNuGetVersion -replace "preview", "alpha"
186186
}
@@ -251,7 +251,7 @@ jobs:
251251

252252
# push NuGet class lib package to NuGet (happens on tag builds for any branch)
253253
- task: NuGetCommand@2
254-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
254+
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], '') )
255255
displayName: Push NuGet packages to NuGet
256256
continueOnError: true
257257
inputs:
@@ -263,7 +263,7 @@ jobs:
263263

264264
# create or update GitHub release ON tags from release or master branches
265265
- task: GitHubReleasePublish@1
266-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
266+
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
267267
displayName: Create/Update GitHub PREVIEW release
268268
inputs:
269269
githubEndpoint: 'nanoFramework'

0 commit comments

Comments
 (0)