Work CD-CI
Add release prep steps.
***NO_CI***
@@ -29,6 +29,13 @@ jobs:
# get commint message
- powershell: |
+ if($env:StartReleaseCandidate -eq "true")
+ {
+ # this is a release prep so NO build
+ echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]true"
+ }
+ else
+ {
# get commit details, if this is a PR
if($env:Build_SourceBranch -like "refs/pull*")
{
@@ -54,10 +61,54 @@ jobs:
echo "##vso[task.setvariable variable=SKIP_BUILD;isOutput=true]false"
}
}
+ }
name: BuildOptions
displayName: Evaluate build options
+ - task: DotNetCoreCLI@2
+ inputs:
+ command: custom
+ custom: tool
+ arguments: install -g nbgv
+ condition: eq( variables['StartReleaseCandidate'], true )
+ displayName: Install NBGV tool
+
+ - powershell: |
+
+ # compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
+ # 'encoded token' is the Base64 of the string "nfbot:personal-token"
+ $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)"))))"
+
+ cd "$env:Agent_TempDirectory" > $null
+
+ git init "$env:Agent_TempDirectory\repo"
+ cd repo > $null
+ git remote add origin "$env:Build_Repository_Uri"
+ git config --global gc.auto 0
+ git config --global user.name nfbot
+ git config --global user.email nanoframework@outlook.com
+ git config --global core.autocrlf true
+ git -c http.extraheader="AUTHORIZATION: $auth" fetch --progress origin
+
+ git checkout develop
+
+ cd source
+
+ nbgv prepare-release
+
+ # get commit message for the merge
+ $commitMessage = git log -1 --pretty=%B
+
+ # amend commit message to skip build
+ git commit --amend -m "$commitMessage" -m "***NO_CI***" > $null
+
+ # push all changes to github
+ git -c http.extraheader="AUTHORIZATION: $auth" push --all origin
+
+ condition: eq( variables['StartReleaseCandidate'], true )
+ displayName: NBGV prepare release
+
#################
# STM32
- job: Build_STM32_targets
