Skip to content

Commit

Permalink
Improve CI & CD (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Oct 17, 2018
1 parent d6e5818 commit 343e220
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion commit-assemblyinfo-changes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ else

'Updated assembly info...' | Write-Host -ForegroundColor White -NoNewline
'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")
{
'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
Expand Down Expand Up @@ -57,7 +63,7 @@ else

# commit changes
git add -A 2>&1
git commit -m"$commitMessage" -m"[version update]" -q
git commit -m"$commitMessage [skip ci]" -m"[version update]" -q
git push --set-upstream origin "$newBranch" --porcelain -q > $null

# start PR
Expand Down
3 changes: 3 additions & 0 deletions generate-change-log.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 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
Expand Down
5 changes: 4 additions & 1 deletion update-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ else
git push --set-upstream origin $newBranchName --porcelain -q

# start PR
$prRequestBody = @{title="$prTitle";body="$commitMessage";head="$newBranchName";base="$env:APPVEYOR_REPO_BRANCH"} | ConvertTo-Json
# we are hardcoding to develop branch to have a fixed one
# this is very important for tags (which don't have branch information)
# considering that the base branch can be changed at the PR ther is no big deal about this
$prRequestBody = @{title="$prTitle";body="$commitMessage";head="$newBranchName";base="develop"} | ConvertTo-Json
$githubApiEndpoint = "https://api.github.com/repos/nanoframework/$library/pulls"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Expand Down

0 comments on commit 343e220

Please sign in to comment.