WOrk CI-CD
Add task to set repo name and version for WIN32 CLR.
# set 'ForceUpload' variable to true on target matrix
steps:
+ - task: PowerShell@2
+ inputs:
+ targetType: 'inline'
+ script: |
+ $repoName = $env:Build_Repository_Name
+ $branchName = $env:Build_SourceBranchName
+
+ Write-Host "repo name is: $repoName"
+ Write-Host "branch name is: $branchName"
+
+ if( $env:Build_SourceBranchName -match "^develop*" -or
+ $env:Build_SourceBranchName -match "^release*" )
+ {
+ # this a dev or release branch, publish to Bintray dev repo
+ Write-Host "$("##vso[task.setvariable variable=BINTRAY_REPO]")nanoframework-images-dev"
+ # set version
+ Write-Host "$("##vso[task.setvariable variable=PACKAGE_VERSION]")$(NBGV_SimpleVersion)-preview.$(NBGV_VersionHeight)"
+ }
+ else
+ {
+ # this master branch, publish to Bintray stable repo
+ Write-Host "$("##vso[task.setvariable variable=BINTRAY_REPO]")nanoframework-images"
+ # set version
+ Write-Host "$("##vso[task.setvariable variable=PACKAGE_VERSION]")$(NBGV_AssemblyVersion)"
+ }
+ errorActionPreference: 'stop'
+ failOnStderr: 'true'
+ # execute on 'ForceUpload' parameter
+ condition: or( eq(variables['ForceUpload'], true), and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), or( eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'master'), contains(variables['Build.SourceBranchName'], 'release') ) ) )
+ displayName: Set Bintray repo path
+
- task: cURLUploader@2
inputs:
files: '$(Build.ArtifactStagingDirectory)\$(TargetPublishName)\nanoFramework.nanoCLR.exe'
