Skip to content

Commit 740e72c

Browse files
committed
Work CD-CI
- Remove nuproj projects and replace with plain nuspec files. - Update AppVeyor yaml accordingly. - Replace gitversion with Nerdbank.GitVersioning. - Rework update dependencies PS to update nuspec instead of nuproj. Signed-off-by: José Simões <[email protected]>
1 parent a64ed55 commit 740e72c

15 files changed

+163
-206
lines changed

GitVersion.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

appveyor.yml

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ skip_commits:
1616
- 'LICENSE'
1717
- dir/*
1818
- '.gitignore'
19+
- 'azure-pipelines.yml'
1920

2021
build:
2122
verbosity: minimal
@@ -44,38 +45,44 @@ init:
4445
- ps: "if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq \"\")\n{\n \n if($env:APPVEYOR_REPO_COMMIT_AUTHOR -eq \"nfbot\" -and $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -like \"*[version update]*\")\n {\n # commit was from nfbot AND it's taged as a [version update]\n # OK to skip AppVeyor build \n \"Version update only. Skipping build.\" | Write-Host -BackgroundColor White -ForegroundColor Blue\n Exit-AppveyorBuild\n }\n}"
4546

4647
install:
47-
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
48-
- bundle config --local path vendor/bundle
49-
- gem install bundler --quiet --no-ri --no-rdoc
50-
- gem install github_changelog_generator --quiet --no-ri --no-rdoc
51-
# this needs to be replace with the official version and nuget package as soon as it's released
52-
- dotnet tool install -g --version 4.0.0-pullrequest1422-1625 --add-source https://ci.appveyor.com/nuget/gitversion-8nigugxjftrw GitVersion.CommandLine.DotNetCore.Tool
53-
- ps: .\install-vsix-appveyor.ps1
54-
55-
build_script:
56-
- ps: >-
57-
58-
msbuild source\nanoFramework.CoreLibrary.sln /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
48+
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
49+
- bundle config --local path vendor/bundle
50+
- gem install bundler --quiet --no-ri --no-rdoc
51+
- gem install github_changelog_generator --quiet --no-ri --no-rdoc
52+
- dotnet tool install --tool-path . nbgv
53+
- ps: .\install-vsix-appveyor.ps1
5954

6055
before_build:
6156
- ps: >-
6257
6358
nuget restore source\nanoFramework.CoreLibrary.sln
6459
65-
dotnet-gitversion /l console /output buildserver /updateAssemblyInfo "source\nanoFramework.CoreLibrary\System\AssemblyInfo2.cs"
60+
.\nbgv cloud -p source -a -c
6661
67-
after_deploy:
68-
# for this environment variable to work here it has to be set in AppVeyor UI
69-
- nuget push source\Nuget.CoreLibrary\bin\Release\nanoFramework.CoreLibrary.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
70-
- nuget push source\Nuget.CoreLibrary.DELIVERABLES\bin\Release\nanoFramework.CoreLibrary.DELIVERABLES.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
62+
build_script:
63+
- ps: msbuild source\nanoFramework.CoreLibrary.sln /p:PublicRelease=true /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
7164

7265
before_deploy:
66+
- ps: >-
67+
.\nbgv cloud --version=$env:NBGV_SemVer1
68+
69+
$env:MyNuGetVersion = $env:NBGV_NuGetPackageVersion -replace "\-g$env:NBGV_GitCommitIdShort", " "
70+
71+
.\generate-change-log.ps1
72+
73+
- nuget pack source\nanoFramework.CoreLibrary.nuspec -Version %MyNuGetVersion%
74+
- nuget pack source\nanoFramework.CoreLibrary.DELIVERABLES.nuspec -Version %MyNuGetVersion%
7375
- ps: >-
7476
.\commit-assemblyinfo-changes.ps1
7577
7678
.\generate-change-log.ps1
7779
78-
Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\source\Nuget.CoreLibrary\bin\Release\nanoFramework.CoreLibrary.$env:GitVersion_NuGetVersionV2.nupkg
80+
Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\nanoFramework.CoreLibrary.$env:MyNuGetVersion.nupkg
81+
82+
after_deploy:
83+
# for this environment variable to work here it has to be set in AppVeyor UI
84+
- nuget push nanoFramework.CoreLibrary.%MyNuGetVersion%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
85+
- nuget push nanoFramework.CoreLibrary.DELIVERABLES.%MyNuGetVersion%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
7986

8087
# requires APPVEYOR_DISCORD_WEBHOOK_URL enviroment variable set with Discord webhook URL
8188
on_failure:
@@ -88,8 +95,6 @@ on_success:
8895

8996
cache:
9097
- source\packages -> **source\packages.config
91-
- C:\ProgramData\chocolatey\bin -> appveyor.yml
92-
- C:\ProgramData\chocolatey\lib -> appveyor.yml
9398

9499
################################################
95100
# override configuration for specific branches
@@ -99,7 +104,7 @@ for:
99104
branches:
100105
only:
101106
- master
102-
- /v.*/
107+
- /v\d.*/
103108

104109
deploy:
105110
- provider: NuGet
@@ -108,9 +113,9 @@ for:
108113
on:
109114
appveyor_repo_tag: true
110115
- provider: GitHub
111-
tag: v$(GitVersion_NuGetVersionV2)
112-
release: nanoFramework Base Class Library v$(GitVersion_NuGetVersionV2)
113-
description: 'Check the [changelog](https://github.com/nanoframework/lib-CoreLibrary/blob/master/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n:package: [.NET](https://www.nuget.org/packages/nanoFramework.CoreLibrary/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
116+
tag: v$(MyNuGetVersion)
117+
release: nanoFramework Base Class Library v$(MyNuGetVersion)
118+
description: 'Check the [changelog](https://github.com/nanoframework/lib-CoreLibrary/blob/master/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n:package: [.NET](https://www.nuget.org/packages/nanoFramework.CoreLibrary/$(MyNuGetVersion)) v$(MyNuGetVersion)'
114119
auth_token:
115120
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
116121
artifact:
@@ -123,16 +128,16 @@ for:
123128
-
124129
branches:
125130
only:
126-
- /dev.*/
131+
- /dev(elop)?$/
127132

128133
deploy:
129134
- provider: GitHub
130-
tag: v$(GitVersion_NuGetVersionV2)
131-
release: nanoFramework Core Library v$(GitVersion_NuGetVersionV2)
132-
description: 'Check the [changelog](https://github.com/nanoframework/lib-CoreLibrary/blob/develop/CHANGELOG.md)\n\n## Install from nanoFramework MyGet development feed\n\nThe following NuGet packages are available for download from this release\n\npackage: [.NET](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.CoreLibrary/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
135+
tag: v$(MyNuGetVersion)
136+
release: nanoFramework Core Library v$(MyNuGetVersion)
137+
description: 'Check the [changelog](https://github.com/nanoframework/lib-CoreLibrary/blob/develop/CHANGELOG.md)\n\n## Install from nanoFramework MyGet development feed\n\nThe following NuGet packages are available for download from this release\n\npackage: [.NET](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.CoreLibrary/$(MyNuGetVersion)) v$(MyNuGetVersion)'
133138
auth_token:
134139
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
135-
artifact: source\Nuget.CoreLibrary\bin\Release\nanoFramework.CoreLibrary.$(GitVersion_NuGetVersionV2).nupkg
140+
artifact: source\Nuget.CoreLibrary\bin\Release\nanoFramework.CoreLibrary.$(MyNuGetVersion).nupkg
136141
draft: true
137142
prerelease: true
138143
force_update: true
@@ -151,9 +156,9 @@ for:
151156
on:
152157
appveyor_repo_tag: true
153158
- provider: GitHub
154-
tag: v$(GitVersion_NuGetVersionV2)
155-
release: nanoFramework Core Library v$(GitVersion_NuGetVersionV2)
156-
description: 'Check the [changelog](https://github.com/nanoframework/lib-CoreLibrary/blob/$(appveyor_repo_branch)/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n:package: [.NET](https://www.nuget.org/packages/nanoFramework.CoreLibrary/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
159+
tag: v$(MyNuGetVersion)
160+
release: nanoFramework Core Library v$(MyNuGetVersion)
161+
description: 'Check the [changelog](https://github.com/nanoframework/lib-CoreLibrary/blob/$(appveyor_repo_branch)/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n:package: [.NET](https://www.nuget.org/packages/nanoFramework.CoreLibrary/$(MyNuGetVersion)) v$(MyNuGetVersion)'
157162
auth_token:
158163
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
159164
artifact:

commit-assemblyinfo-changes.ps1

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

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")
6-
{
7-
'Skip committing assembly info changes as this is not a tag build...' | Write-Host -ForegroundColor White
8-
}
9-
else
10-
{
11-
# updated assembly info files
12-
git add "source\nanoFramework.CoreLibrary\System\AssemblyInfo2.cs"
13-
git commit -m "Update assembly info file for v$env:GitVersion_NuGetVersionV2" -m"[version update]"
14-
git push origin --porcelain -q > $null
15-
16-
'Updated assembly info...' | Write-Host -ForegroundColor White -NoNewline
17-
'OK' | Write-Host -ForegroundColor Green
18-
}
19-
204
# update assembly info in nf-interpreter if this is tag
215
if ($env:APPVEYOR_REPO_TAG -eq "true")
226
{
@@ -27,13 +11,13 @@ if ($env:APPVEYOR_REPO_TAG -eq "true")
2711
cd nf-interpreter > $null
2812

2913
# new branch name
30-
$newBranch = "$env:APPVEYOR_REPO_BRANCH-nfbot/update-version/nanoFramework.CorLib/$env:GitVersion_NuGetVersionV2"
14+
$newBranch = "$env:APPVEYOR_REPO_BRANCH-nfbot/update-version/nanoFramework.CorLib/$env:MyNuGetVersion"
3115

3216
# create branch to perform updates
3317
git checkout -b "$newBranch" develop -q
3418

3519
# replace version in assembly declaration
36-
$newVersion = $env:GitVersion_AssemblySemFileVer -replace "\." , ", "
20+
$newVersion = $env:NBGV_AssemblyFileVersion -replace "\." , ", "
3721
$newVersion = "{ $newVersion }"
3822

3923
$versionRegex = "\{\s*\d+\,\s*\d+\,\s*\d+\,\s*\d+\s*}"
@@ -56,7 +40,7 @@ if ($env:APPVEYOR_REPO_TAG -eq "true")
5640
}
5741
else
5842
{
59-
$commitMessage = "Update nanoFramework.CorLib version to $env:GitVersion_NuGetVersionV2"
43+
$commitMessage = "Update nanoFramework.CorLib version to $env:MyNuGetVersion"
6044

6145
# commit changes
6246
git add -A 2>&1

generate-change-log.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ else
1414
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -or $env:APPVEYOR_REPO_BRANCH -match "^release*")
1515
{
1616
# generate change log including future version
17-
bundle exec github_changelog_generator --token $env:GitHubToken --future-release "v$env:GitVersion_MajorMinorPatch"
17+
bundle exec github_changelog_generator --token $env:GitHubToken --future-release "v$env:NBGV_Version"
1818
}
1919
else
2020
{
@@ -23,8 +23,14 @@ else
2323
bundle exec github_changelog_generator --token $env:GitHubToken
2424
}
2525

26-
# updated changelog and the updated assembly info files
27-
git add CHANGELOG.md
28-
git commit -m "Update CHANGELOG for v$env:GitVersion_NuGetVersionV2"
29-
git push origin --porcelain -q > $null
26+
# updated changelog, if there are any differences
27+
$logDif = git diff CHANGELOG.md
28+
29+
if($logDif -ne $null)
30+
{
31+
git add CHANGELOG.md
32+
git commit -m "Update CHANGELOG for v$env:MyNuGetVersion"
33+
# need to wrap the git command bellow so it doesn't throw an error because of redirecting the output to stderr
34+
git push origin --porcelain | Write-Host
35+
}
3036
}

source/Nuget.CoreLibrary.DELIVERABLES/Nuget.CoreLibrary.DELIVERABLES.nuproj

Lines changed: 0 additions & 66 deletions
This file was deleted.

source/Nuget.CoreLibrary/Nuget.CoreLibrary.nuproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<Import Project="$(NuProjPath)\NuProj.props" Condition="Exists('$(NuProjPath)\NuProj.props')" />
4343
<PropertyGroup Label="Configuration">
4444
<Id>nanoFramework.CoreLibrary</Id>
45-
<Version>$(GitVersion_NuGetVersionV2)</Version>
45+
<Version>1.0.5-preview024</Version>
4646
<Title>nanoFramework.CoreLibrary</Title>
4747
<Authors>nanoFramework project contributors</Authors>
4848
<Owners>nanoFramework project contributors</Owners>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
<id>nanoFramework.CoreLibrary.DELIVERABLES</id>
5+
<version>$version$</version>
6+
<title>nanoFramework.CoreLibrary.DELIVERABLES</title>
7+
<authors>nanoFramework project contributors</authors>
8+
<owners>nanoFramework project contributors</owners>
9+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
10+
<releaseNotes></releaseNotes>
11+
<developmentDependency>false</developmentDependency>
12+
<projectUrl>https://github.com/nanoframework/lib-CoreLibrary</projectUrl>
13+
<iconUrl>https://secure.gravatar.com/avatar/97d0e092247f0716db6d4b47b7d1d1ad</iconUrl>
14+
<copyright>Copyright (c) 2018 The nanoFramework project contributors</copyright>
15+
<description>** DON'T REFERENCE THIS PACKAGE ** Not meant for development. This package includes the deliverable artifacts of the base class library (mscorlib) of nanoFramework. These are for testing purposes and for updating the native code base of the core library.</description>
16+
<summary>nanoFramework.CoreLibrary.DELIVERABLES is not meant for development</summary>
17+
<tags></tags>
18+
</metadata>
19+
<files>
20+
<file src="nanoFramework.CoreLibrary\bin\Release\Stubs\*.*" target="content\Stubs\" />
21+
<file src="nanoFramework.CoreLibrary\obj\Release\*.txt" target="content\txt\" />
22+
<file src="nanoFramework.CoreLibrary\obj\Release\*.dump" target="content\dump\" />
23+
<file src="nanoFramework.CoreLibrary\obj\Release\*.strings" target="content\dump\" />
24+
<file src="nanoFramework.CoreLibrary\obj\Release\*.resources" target="content\resources\" />
25+
<file src="nanoFramework.CoreLibrary\obj\Release\*.il" target="content\disasm\" />
26+
</files>
27+
</package>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
<id>nanoFramework.CoreLibrary</id>
5+
<version>$version$</version>
6+
<title>nanoFramework.CoreLibrary</title>
7+
<authors>nanoFramework project contributors</authors>
8+
<owners>nanoFramework project contributors</owners>
9+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
10+
<releaseNotes></releaseNotes>
11+
<developmentDependency>false</developmentDependency>
12+
<projectUrl>https://github.com/nanoframework/lib-CoreLibrary</projectUrl>
13+
<iconUrl>https://secure.gravatar.com/avatar/97d0e092247f0716db6d4b47b7d1d1ad</iconUrl>
14+
<copyright>Copyright (c) 2018 The nanoFramework project contributors</copyright>
15+
<description>This package includes the nanoFramework.CoreLibrary assembly for nanoFramework C# projects.</description>
16+
<summary>This package includes the nanoFramework.CoreLibrary assembly for nanoFramework C# projects.</summary>
17+
<tags>nanoFramework C# csharp netmf netnf nanoFramework.CoreLibrary</tags>
18+
</metadata>
19+
<files>
20+
<file src="nanoFramework.CoreLibrary\bin\Release\mscorlib.dll" target="lib\mscorlib.dll" />
21+
<file src="nanoFramework.CoreLibrary\bin\Release\mscorlib.pdb" target="lib\mscorlib.pdb" />
22+
<file src="nanoFramework.CoreLibrary\bin\Release\mscorlib.pdbx" target="lib\mscorlib.pdbx" />
23+
<file src="nanoFramework.CoreLibrary\bin\Release\mscorlib.pe" target="lib\mscorlib.pe" />
24+
<file src="nanoFramework.CoreLibrary\bin\Release\mscorlib.xml" target="lib\mscorlib.xml" />
25+
</files>
26+
</package>

0 commit comments

Comments
 (0)