Skip to content

Commit 40e2f11

Browse files
committed
Work CD-CI
- Remove nuproj projects and replace with plain nuspec files. - Update AppVeyor yaml accordingly. - Replace gitversion with Nerdbank.GitVersioning. Signed-off-by: José Simões <jose.simoes@eclo.solutions>
1 parent 5fe325d commit 40e2f11

12 files changed

Lines changed: 99 additions & 113 deletions

GitVersion.yml

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

appveyor.yml

Lines changed: 30 additions & 27 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,13 +45,12 @@ 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
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
5454

5555
before_build:
5656
- ps: >-
@@ -59,25 +59,30 @@ before_build:
5959
6060
nuget restore source\nanoFramework.System.Net.Http.sln
6161
62-
dotnet-gitversion /l console /output buildserver /updateAssemblyInfo "source\nanoFramework.System.Net.Http\Properties\AssemblyInfo.cs"
62+
.\nbgv cloud -p source -a -c
6363
6464
build_script:
65-
- ps: >-
66-
67-
msbuild source\nanoFramework.System.Net.Http.sln /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
65+
- ps: msbuild source\nanoFramework.System.Net.Http.sln /p:PublicRelease=true /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
6866

6967
before_deploy:
68+
- ps: >-
69+
.\nbgv cloud --version=$env:NBGV_SemVer1
70+
71+
$env:MyNuGetVersion = $env:NBGV_NuGetPackageVersion -replace "\-g$env:NBGV_GitCommitIdShort", " "
72+
73+
.\generate-change-log.ps1
74+
75+
- nuget pack source\nanoFramework.System.Net.Http.nuspec -Version %MyNuGetVersion%
7076
- ps: >-
7177
.\commit-assemblyinfo-changes.ps1
7278
7379
.\generate-change-log.ps1
7480
75-
Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\source\Nuget.nanoFramework.System.Net.Http\bin\Release\nanoFramework.System.Net.Http.$env:GitVersion_NuGetVersionV2.nupkg
81+
Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\nanoFramework.System.Net.Http.$env:MyNuGetVersion.nupkg
7682
7783
after_deploy:
7884
# for this environment variable to work here it has to be set in AppVeyor UI
79-
- nuget push source\Nuget.nanoFramework.System.Net.Http\bin\Release\nanoFramework.System.Net.Http.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
80-
- nuget push source\Nuget.nanoFramework.System.Net.Http.DELIVERABLES\bin\Release\nanoFramework.System.Net.Http.DELIVERABLES.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
85+
- nuget push nanoFramework.System.Net.Http.%MyNuGetVersion%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
8186

8287
# requires APPVEYOR_DISCORD_WEBHOOK_URL enviroment variable set with Discord webhook URL
8388
on_failure:
@@ -87,8 +92,6 @@ on_failure:
8792
8893
cache:
8994
- source\packages -> **source\packages.config
90-
- C:\ProgramData\chocolatey\bin -> appveyor.yml
91-
- C:\ProgramData\chocolatey\lib -> appveyor.yml
9295

9396
################################################
9497
# override configuration for specific branches
@@ -98,7 +101,7 @@ for:
98101
branches:
99102
only:
100103
- master
101-
- /v.*/
104+
- /v\d.*/
102105

103106
deploy:
104107
- provider: NuGet
@@ -107,9 +110,9 @@ for:
107110
on:
108111
appveyor_repo_tag: true
109112
- provider: GitHub
110-
tag: v$(GitVersion_NuGetVersionV2)
111-
release: nanoFramework System.Net.Http Library v$(GitVersion_NuGetVersionV2)
112-
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.System.Net.Http/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.System.Net.Http/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
113+
tag: v$(MyNuGetVersion)
114+
release: nanoFramework System.Net.Http Library v$(MyNuGetVersion)
115+
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.System.Net.Http/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.System.Net.Http/$(MyNuGetVersion)) v$(MyNuGetVersion)'
113116
auth_token:
114117
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
115118
artifact:
@@ -122,13 +125,13 @@ for:
122125
-
123126
branches:
124127
only:
125-
- /dev.*/
128+
- /dev(elop)?$/
126129

127130
deploy:
128131
- provider: GitHub
129-
tag: v$(GitVersion_NuGetVersionV2)
130-
release: nanoFramework System.Net.Http Library v$(GitVersion_NuGetVersionV2)
131-
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.System.Net.Http/blob/$(appveyor_repo_branch)/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.System.Net.Http/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
132+
tag: v$(MyNuGetVersion)
133+
release: nanoFramework System.Net.Http Library v$(MyNuGetVersion)
134+
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.System.Net.Http/blob/$(appveyor_repo_branch)/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.System.Net.Http/$(MyNuGetVersion)) v$(MyNuGetVersion)'
132135
auth_token:
133136
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
134137
artifact: Nuget_Packages
@@ -150,9 +153,9 @@ for:
150153
on:
151154
appveyor_repo_tag: true
152155
- provider: GitHub
153-
tag: v$(GitVersion_NuGetVersionV2)
154-
release: nanoFramework System.Net.Http Library v$(GitVersion_NuGetVersionV2)
155-
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.System.Net.Http/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.System.Net.Http/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
156+
tag: v$(MyNuGetVersion)
157+
release: nanoFramework System.Net.Http Library v$(MyNuGetVersion)
158+
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.System.Net.Http/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.System.Net.Http/$(MyNuGetVersion)) v$(MyNuGetVersion)'
156159
auth_token:
157160
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
158161
artifact:

commit-assemblyinfo-changes.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ else
1010
{
1111
# updated assembly info files
1212
git add "source\nanoFramework.System.Net.Http\Properties\AssemblyInfo.cs"
13-
git commit -m "Update assembly info file for v$env:GitVersion_NuGetVersionV2" -m"[version update]"
13+
git commit -m "Update assembly info file for v$env:MyNuGetVersion" -m"[version update]"
1414
git push origin --porcelain -q > $null
1515

1616
'Updated assembly info...' | Write-Host -ForegroundColor White -NoNewline

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
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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.System.Net.Http</id>
5+
<version>$version$</version>
6+
<title>nanoFramework.System.Net.Http</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</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.System.Net.Http assembly for nanoFramework C# projects.</description>
16+
<summary>nanoFramework.System.Net.Http assembly for nanoFramework C# projects</summary>
17+
<tags>nanoFramework C# csharp netmf netnf nanoFramework.System.Net.Http</tags>
18+
<dependencies>
19+
<dependency id="nanoFramework.CoreLibrary" version="[1.0.5-preview024]" />
20+
</dependencies>
21+
</metadata>
22+
<files>
23+
<file src="nanoFramework.System.Net.Http\bin\Release\System.Net.Http.dll" target="lib\System.Net.Http.dll" />
24+
<file src="nanoFramework.System.Net.Http\bin\Release\System.Net.Http.pdb" target="lib\System.Net.Http.pdb" />
25+
<file src="nanoFramework.System.Net.Http\bin\Release\System.Net.Http.pdbx" target="lib\System.Net.Http.pdbx" />
26+
<file src="nanoFramework.System.Net.Http\bin\Release\System.Net.Http.pe" target="lib\System.Net.Http.pe" />
27+
<file src="nanoFramework.System.Net.Http\bin\Release\System.Net.Http.xml" target="lib\System.Net.Http.xml" />
28+
</files>
29+
</package>

source/nanoFramework.System.Net.Http.sln

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ VisualStudioVersion = 15.0.28010.2041
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "System.Net.Http", "nanoFramework.System.Net.Http\System.Net.Http.nfproj", "{C3ABA656-9831-4006-A3B3-EA842A3C508E}"
77
EndProject
8-
Project("{FF286327-C783-4F7A-AB73-9BCBAD0D4460}") = "Nuget.nanoFramework.System.Net.Http", "Nuget.nanoFramework.System.Net.Http\Nuget.nanoFramework.System.Net.Http.nuproj", "{DEA3BF64-3B74-473D-B8A4-0232756F5477}"
9-
ProjectSection(ProjectDependencies) = postProject
10-
{C3ABA656-9831-4006-A3B3-EA842A3C508E} = {C3ABA656-9831-4006-A3B3-EA842A3C508E}
11-
EndProjectSection
12-
EndProject
13-
Project("{FF286327-C783-4F7A-AB73-9BCBAD0D4460}") = "Nuget.nanoFramework.System.Net.Http.DELIVERABLES", "Nuget.nanoFramework.System.Net.Http.DELIVERABLES\Nuget.nanoFramework.System.Net.Http.DELIVERABLES.nuproj", "{F81B4DAC-449C-48E4-80EA-4360C8F8C2DD}"
14-
ProjectSection(ProjectDependencies) = postProject
15-
{C3ABA656-9831-4006-A3B3-EA842A3C508E} = {C3ABA656-9831-4006-A3B3-EA842A3C508E}
16-
EndProjectSection
17-
EndProject
188
Global
199
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2010
Debug|Any CPU = Debug|Any CPU
@@ -26,14 +16,6 @@ Global
2616
{C3ABA656-9831-4006-A3B3-EA842A3C508E}.Release|Any CPU.ActiveCfg = Release|Any CPU
2717
{C3ABA656-9831-4006-A3B3-EA842A3C508E}.Release|Any CPU.Build.0 = Release|Any CPU
2818
{C3ABA656-9831-4006-A3B3-EA842A3C508E}.Release|Any CPU.Deploy.0 = Release|Any CPU
29-
{DEA3BF64-3B74-473D-B8A4-0232756F5477}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30-
{DEA3BF64-3B74-473D-B8A4-0232756F5477}.Debug|Any CPU.Build.0 = Debug|Any CPU
31-
{DEA3BF64-3B74-473D-B8A4-0232756F5477}.Release|Any CPU.ActiveCfg = Release|Any CPU
32-
{DEA3BF64-3B74-473D-B8A4-0232756F5477}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{F81B4DAC-449C-48E4-80EA-4360C8F8C2DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{F81B4DAC-449C-48E4-80EA-4360C8F8C2DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{F81B4DAC-449C-48E4-80EA-4360C8F8C2DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
36-
{F81B4DAC-449C-48E4-80EA-4360C8F8C2DD}.Release|Any CPU.Build.0 = Release|Any CPU
3719
EndGlobalSection
3820
GlobalSection(SolutionProperties) = preSolution
3921
HideSolutionNode = FALSE

source/nanoFramework.System.Net.Http/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,3 @@
1515
// to COM components. If you need to access a type in this assembly from
1616
// COM, set the ComVisible attribute to true on that type.
1717
[assembly: ComVisible(false)]
18-
19-
// Version information for an assembly consists of the following four values:
20-
//
21-
// Major Version
22-
// Minor Version
23-
// Build Number
24-
// Revision
25-
//
26-
// You can specify all the values or you can default the Build and Revision Numbers
27-
// by using the '*' as shown below:
28-
// [assembly: AssemblyVersion("1.0.0.0")]
29-
[assembly: AssemblyVersion("1.0.0.0")]
30-
[assembly: AssemblyFileVersion("1.0.0.0")]
31-
[assembly: AssemblyInformationalVersion("1.0.0-preview016")]

source/nanoFramework.System.Net.Http/README.md

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

source/nanoFramework.System.Net.Http/README.txt

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

source/nanoFramework.System.Net.Http/System.Net.Http.nfproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<None Include="packages.config" />
8080
</ItemGroup>
8181
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
82+
<Import Project="..\packages\Nerdbank.GitVersioning.2.2.13\build\Nerdbank.GitVersioning.targets" />
8283
<ProjectExtensions>
8384
<ProjectCapabilities>
8485
<ProjectConfigurationsDeclaredAsItems />

0 commit comments

Comments
 (0)