From c48210eb114697f8947a1e13c3c9e3ba9de9c47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 26 Oct 2018 14:15:45 +0100 Subject: [PATCH] Work on CD/CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix condition for generating changelog and commit assembly info updated - Minor improvements on PS Signed-off-by: José Simões --- commit-assemblyinfo-changes.ps1 | 13 +++++-------- generate-change-log.ps1 | 9 +++------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/commit-assemblyinfo-changes.ps1 b/commit-assemblyinfo-changes.ps1 index 79a00ab..73b69ef 100644 --- a/commit-assemblyinfo-changes.ps1 +++ b/commit-assemblyinfo-changes.ps1 @@ -1,11 +1,8 @@ # Copyright (c) 2018 The nanoFramework project contributors # See LICENSE file in the project root for full license information. -# skip updating assembly info changes if build is a pull-request or not a tag (master OR release) -if ($env:appveyor_pull_request_number -or - ($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq 'true') -or - ($env:APPVEYOR_REPO_BRANCH -match "^release*" -and $env:APPVEYOR_REPO_TAG -eq 'true') -or - $env:APPVEYOR_REPO_TAG -eq "true") +# skip updating assembly info changes if build is a pull-request or not a tag (can't commit when repo is in a tag) +if ($env:appveyor_pull_request_number -or $env:APPVEYOR_REPO_TAG -eq "true") { 'Skip committing assembly info changes...' | Write-Host -ForegroundColor White } @@ -20,14 +17,14 @@ else 'OK' | Write-Host -ForegroundColor Green } -# update assembly info in nf-interpreter if we are in development branch or if this is tag (master OR release) -if ($env:APPVEYOR_REPO_BRANCH -match "^dev*" -or $env:APPVEYOR_REPO_TAG -eq "true") +# update assembly info in nf-interpreter if this is tag +if ($env:APPVEYOR_REPO_TAG -eq "true") { 'Updating assembly version in nf-interpreter...' | Write-Host -ForegroundColor White -NoNewline # clone nf-interpreter repo (only a shallow clone with last commit) git clone https://github.com/nanoframework/nf-interpreter -b develop --depth 1 -q - cd nf-interpreter + cd nf-interpreter > $null # new branch name $newBranch = "$env:APPVEYOR_REPO_BRANCH-nfbot/update-version/nanoFramework.System.Math/$env:GitVersion_NuGetVersionV2" diff --git a/generate-change-log.ps1 b/generate-change-log.ps1 index a9d3395..b9b4851 100644 --- a/generate-change-log.ps1 +++ b/generate-change-log.ps1 @@ -1,18 +1,15 @@ # Copyright (c) 2018 The nanoFramework project contributors # See LICENSE file in the project root for full license information. -# generate change log when build is NOT a pull-request or not a tag (master OR release) -if ($env:appveyor_pull_request_number -or - ($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq 'true') -or - ($env:APPVEYOR_REPO_BRANCH -match "^release*" -and $env:APPVEYOR_REPO_TAG -eq 'true') -or - $env:APPVEYOR_REPO_TAG -eq "true") +# skip generating the change log when build is a pull-request or not a tag (can't commit when repo is in a tag) +if ($env:appveyor_pull_request_number -or $env:APPVEYOR_REPO_TAG -eq "true") { 'Skip change log processing...' | Write-Host -ForegroundColor White } else { # need this to keep ruby happy - md c:\tmp + md c:\tmp > $null if ($env:APPVEYOR_REPO_BRANCH -eq "master" -or $env:APPVEYOR_REPO_BRANCH -match "^release*") {