Skip to content

Commit 35638b2

Browse files
authored
Work on CD/CI [skip ci] (#53)
1 parent a737c11 commit 35638b2

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed

commit-assemblyinfo-changes.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# only need to commit assembly info changes when build is NOT for a pull-request
2-
if ($env:appveyor_pull_request_number)
1+
# Copyright (c) 2018 The nanoFramework project contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
# skip updating assembly info changes if build is a pull-request or not a tag (can't commit when repo is in a tag)
5+
if ($env:appveyor_pull_request_number -or $env:APPVEYOR_REPO_TAG -eq "true")
36
{
4-
'Skip committing assembly info changes as this is a PR build...' | Write-Host -ForegroundColor White
7+
'Skip committing assembly info changes as this is not a tag build...' | Write-Host -ForegroundColor White
58
}
69
else
710
{
@@ -15,7 +18,7 @@ else
1518

1619
# clone nf-interpreter repo (only a shallow clone with last commit)
1720
git clone https://github.com/nanoframework/nf-interpreter -b develop --depth 1 -q
18-
cd nf-interpreter
21+
cd nf-interpreter > $null
1922

2023
# new branch name
2124
$newBranch = "$env:APPVEYOR_REPO_BRANCH-nfbot/update-version/nanoFramework.CorLib/$env:GitVersion_NuGetVersionV2"
@@ -51,7 +54,7 @@ else
5154

5255
# commit changes
5356
git add -A 2>&1
54-
git commit -m"$commitMessage" -m"[version update]" -q
57+
git commit -m"$commitMessage" -q
5558
git push --set-upstream origin "$newBranch" --porcelain -q > $null
5659

5760
# start PR

generate-change-log.ps1

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1+
# Copyright (c) 2018 The nanoFramework project contributors
2+
# See LICENSE file in the project root for full license information.
3+
14
# generate change log when build is NOT for a pull-request
2-
if ($env:appveyor_pull_request_number)
5+
if ($env:appveyor_pull_request_number -or $env:APPVEYOR_REPO_TAG -eq "true")
36
{
4-
'Skip change log processing as this is a PR build...' | Write-Host -ForegroundColor White
7+
'Skip change log processing...' | Write-Host -ForegroundColor White
58
}
69
else
710
{
811
# need this to keep ruby happy
9-
md c:\tmp
12+
md c:\tmp > $null
1013

11-
# generate change log
12-
# version includes commits
13-
bundle exec github_changelog_generator --token $env:GitHubToken
14+
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -or $env:APPVEYOR_REPO_BRANCH -match "^release*")
15+
{
16+
# generate change log including future version
17+
bundle exec github_changelog_generator --token $env:GitHubToken --future-release "v$env:GitVersion_MajorMinorPatch"
18+
}
19+
else
20+
{
21+
# generate change log
22+
# version includes commits
23+
bundle exec github_changelog_generator --token $env:GitHubToken
24+
}
1425

1526
# updated changelog and the updated assembly info files
1627
git add CHANGELOG.md

update-dependencies.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
# Copyright (c) 2018 The nanoFramework project contributors
22
# See LICENSE file in the project root for full license information.
33

4-
# only need to update dependencies when build is NOT for a pull-request
5-
if ($env:appveyor_pull_request_number)
4+
# only need to update dependencies when build is a tag
5+
if ($env:appveyor_pull_request_number -or $env:APPVEYOR_REPO_TAG -eq "false")
66
{
7-
'Skip updating dependencies as this is a PR build...' | Write-Host -ForegroundColor White
7+
'Skip updating dependencies as this is not a tag build...' | Write-Host -ForegroundColor White
88
}
99
else
1010
{
1111
# update dependencies for class libraries that depend ONLY on mscorlib
1212

1313
# because it can take sometime for the package to become available on the NuGet providers
14-
# need to hange here for 5 minutes (5 * 60 * 1000)
14+
# need to hang here for 5 minutes (5 * 60)
1515
"Waiting 5 minutes to let package process flow in NuGet providers..." | Write-Host -ForegroundColor White
16-
Start-Sleep -Milliseconds 300000
16+
17+
For ($i=300; $i -gt 0; $i-)
18+
{
19+
Write-Host "`r$i seconds remaining " -NoNewLine
20+
Start-Sleep -Seconds 1
21+
}
22+
Write-Host "`r "
1723

1824
$librariesToUpdate = ("lib-nanoFramework.Runtime.Events",
1925
"lib-nanoFramework.Runtime.Native",

0 commit comments

Comments
 (0)