Skip to content

Commit eaa203c

Browse files
committed
Improvements on CI & CD
Signed-off-by: José Simões <[email protected]>
1 parent f3612a0 commit eaa203c

File tree

3 files changed

+47
-21
lines changed

3 files changed

+47
-21
lines changed

appveyor.yml

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# configuration these branches
2-
branches:
3-
only:
4-
- master
5-
- /dev.*/
6-
- /release.*/
7-
- /v.*/
1+
# configuration for all branches
82

93
image: Visual Studio 2017
104

@@ -81,6 +75,11 @@ before_deploy:
8175
8276
Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\source\Nuget.nanoFramework.Networking.Sntp\bin\Release\nanoFramework.Networking.Sntp.$env:GitVersion_NuGetVersionV2.nupkg
8377
78+
after_deploy:
79+
# for this environment variable to work here it has to be set in AppVeyor UI
80+
- nuget push source\Nuget.nanoFramework.Networking.Sntp\bin\Release\nanoFramework.Networking.Sntp.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
81+
- nuget push source\Nuget.nanoFramework.Networking.Sntp.DELIVERABLES\bin\Release\nanoFramework.Networking.Sntp.DELIVERABLES.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
82+
8483
# requires APPVEYOR_DISCORD_WEBHOOK_URL enviroment variable set with Discord webhook URL
8584
on_failure:
8685
- ps: |
@@ -118,7 +117,8 @@ for:
118117
draft: true
119118
prerelease: false
120119
force_update: true
121-
120+
on:
121+
appveyor_repo_tag: false
122122
-
123123
branches:
124124
only:
@@ -135,11 +135,8 @@ for:
135135
draft: true
136136
prerelease: true
137137
force_update: true
138-
139-
after_deploy:
140-
# for this environment variable to work here it has to be set in AppVeyor UI
141-
- nuget push source\Nuget.nanoFramework.Networking.Sntp\bin\Release\nanoFramework.Networking.Sntp.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
142-
- nuget push source\Nuget.nanoFramework.Networking.Sntp.DELIVERABLES\bin\Release\nanoFramework.Networking.Sntp.DELIVERABLES.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
138+
on:
139+
appveyor_repo_tag: false
143140

144141
-
145142
branches:
@@ -162,3 +159,5 @@ for:
162159
draft: true
163160
prerelease: true
164161
force_update: true
162+
on:
163+
appveyor_repo_tag: false

commit-assemblyinfo-changes.ps1

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
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 (master OR release)
5+
if ($env:appveyor_pull_request_number -or
6+
($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq 'true') -or
7+
($env:APPVEYOR_REPO_BRANCH -match "^release*" -and $env:APPVEYOR_REPO_TAG -eq 'true') -or
8+
$env:APPVEYOR_REPO_TAG -eq "true")
39
{
4-
'Skip committing assembly info changes as this is a PR build...' | Write-Host -ForegroundColor White
10+
'Skip committing assembly info changes...' | Write-Host -ForegroundColor White
511
}
612
else
713
{
@@ -12,6 +18,12 @@ else
1218

1319
'Updated assembly info...' | Write-Host -ForegroundColor White -NoNewline
1420
'OK' | Write-Host -ForegroundColor Green
21+
}
22+
23+
# update assembly info in nf-interpreter if we are in development branch or if this is tag (master OR release)
24+
if ($env:APPVEYOR_REPO_BRANCH -match "^dev*" -or $env:APPVEYOR_REPO_TAG -eq "true")
25+
{
26+
'Updating assembly version in nf-interpreter...' | Write-Host -ForegroundColor White -NoNewline
1527

1628
# clone nf-interpreter repo (only a shallow clone with last commit)
1729
git clone https://github.com/nanoframework/nf-interpreter -b develop --depth 1 -q

generate-change-log.ps1

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
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+
# generate change log when build is NOT a pull-request or not a tag (master OR release)
6+
if ($env:appveyor_pull_request_number -or
7+
($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq 'true') -or
8+
($env:APPVEYOR_REPO_BRANCH -match "^release*" -and $env:APPVEYOR_REPO_TAG -eq 'true') -or
9+
$env:APPVEYOR_REPO_TAG -eq "true")
310
{
4-
'Skip change log processing as this is a PR build...' | Write-Host -ForegroundColor White
11+
'Skip change log processing...' | Write-Host -ForegroundColor White
512
}
613
else
714
{
815
# need this to keep ruby happy
916
md c:\tmp
1017

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

1530
# updated changelog and the updated assembly info files
1631
git add CHANGELOG.md

0 commit comments

Comments
 (0)