Skip to content

Commit 2ccd585

Browse files
committed
Work CD-CI
- Move project to standard location. - Rename solution and project to match project pattern. - Update nuspec. - Add icon and readme. - Update license and readme (WIP). - Update Azure Pipeline yaml.
1 parent 80b97ef commit 2ccd585

26 files changed

+139
-171
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Laurent Ellerbach and Contributors
3+
Copyright (c) .NET Foundation and Contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
# .NET nanoFramework WebServer
1+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.WebServer&metric=alert_status)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.WebServer) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.WebServer&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.WebServer) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![NuGet](https://img.shields.io/nuget/dt/nanoFramework.WebServer.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.WebServer/) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord&logoColor=white&label=Discord&color=7289DA)](https://discord.gg/gCyBu8T)
2+
3+
![nanoFramework logo](https://github.com/nanoframework/Home/blob/master/resources/logo/nanoFramework-repo-logo.png)
4+
5+
-----
6+
7+
### Welcome to the **nanoFramework** WebServer repository!
8+
9+
## Build status
10+
11+
| Component | Build Status | NuGet Package |
12+
|:-|---|---|
13+
| nanoFramework.WebServer | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.WebServer/_apis/build/status/nanoframework.lib-nanoFramework.WebServer?branchName=develop)](https://dev.azure.com/nanoframework/nanoFramework.WebServer/_build/latest?definitionId=1?branchName=master) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.WebServer.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.WebServer/) |
14+
| nanoFramework.WebServer (preview) | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.WebServer/_apis/build/status/nanoframework.lib-nanoFramework.WebServer?branchName=develop)](https://dev.azure.com/nanoframework/nanoFramework.WebServer/_build/latest?definitionId=1?branchName=develop) | [![](https://badgen.net/badge/NuGet/preview/D7B023?icon=https://simpleicons.now.sh/azuredevops/fff)](https://dev.azure.com/nanoframework/feed/_packaging?_a=package&feed=sandbox&package=nanoFramework.WebServer&protocolType=NuGet&view=overview) |
15+
16+
## .NET nanoFramework WebServer
17+
18+
This library was coded by [Laurent Ellerbach](@Ellerbach) who generously offered the project to the **nanoFramework** project.
219

320
This is a simple nanoFramework WebServer. Features:
421

5-
- Handle multithread requests
22+
- Handle multi-thread requests
623
- Serve static files on any storage
724
- Handle parameter in URL
825
- Possible to have multiple WebServer running at the same time
@@ -350,3 +367,26 @@ using (WebServer server = new WebServer(443, HttpProtocol.Https)
350367
> IMPORTANT: because the certificate above is not issued from a Certificate Authority it won't be recognized as a valid certificate. If you want to access the nanoFramework device with your browser, for example, you'll have to add the (CRT file)[WebServer.Sample\webserver-cert.crt] as a trusted one. On Windows, you just have to double click on the CRT file and then click "Install Certificate...".
351368

352369
You can of course use the routes as defined earlier. Both will work, event or route with the notion of controller.
370+
371+
## Feedback and documentation
372+
373+
For documentation, providing feedback, issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).
374+
375+
Join our Discord community [here](https://discord.gg/gCyBu8T).
376+
377+
## Credits
378+
379+
The list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/master/CONTRIBUTORS.md).
380+
381+
## License
382+
383+
The **nanoFramework** WebServer library is licensed under the [MIT license](LICENSE.md).
384+
385+
## Code of Conduct
386+
387+
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
388+
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
389+
390+
### .NET Foundation
391+
392+
This project is supported by the [.NET Foundation](https://dotnetfoundation.org).

WebServer.GpioRest/WebServer.GpioRest.nfproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<Compile Include="Properties\AssemblyInfo.cs" />
2626
</ItemGroup>
2727
<ItemGroup>
28-
<ProjectReference Include="..\WebServer\WebServer.nfproj" />
28+
<ProjectReference Include="..\nanoFramework.WebServer\nanoFramework.WebServer.nfproj" />
2929
</ItemGroup>
3030
<ItemGroup>
3131
<Reference Include="mscorlib, Version=1.9.1.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">

WebServer.Sample/WebServer.Sample.nfproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</Compile>
3333
</ItemGroup>
3434
<ItemGroup>
35-
<ProjectReference Include="..\WebServer\WebServer.nfproj" />
35+
<ProjectReference Include="..\nanoFramework.WebServer\nanoFramework.WebServer.nfproj" />
3636
</ItemGroup>
3737
<ItemGroup>
3838
<None Include="packages.config" />

azure-pipelines.yml

Lines changed: 25 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,44 @@
1-
# no trigger config here, this is handled at Azure Pipelines interface
1+
trigger:
2+
branches:
3+
include: [master, develop, "release-*" ]
4+
paths:
5+
exclude: ["*.md", .gitignore]
6+
tags:
7+
include: ["v*"]
8+
9+
# PR always trigger build
210

311
# add nf-tools repo to resources (for Azure Pipelines templates)
412
resources:
513
repositories:
614
- repository: templates
715
type: github
816
name: nanoframework/nf-tools
9-
endpoint: nfbot
10-
- repository: webserver
11-
type: github
12-
endpoint: ellerbach
13-
name: ellerbach/nanoFramework.Webserver
14-
ref: master
17+
endpoint: nanoframework
1518

1619
pool:
1720
vmImage: 'VS2017-Win2016'
1821

1922
variables:
2023
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
21-
solution: './webserver/WebServer.sln'
24+
solution: 'nanoFramework.WebServer'
2225
buildPlatform: 'Any CPU'
2326
buildConfiguration: 'Release'
24-
NF_Library: 'nanoFramework.WebServer'
25-
# creates a counter called versioncounter and assigns it to the minor variable
26-
REVISION: $[counter('versioncounter', 200)]
27+
nugetPackageName: 'nanoFramework.WebServer'
28+
repoName: 'lib-nanoFramework.WebServer'
2729

2830
steps:
2931

30-
- checkout: self
31-
fetchDepth: 1
32-
path: s/cd
33-
- checkout: webserver
34-
fetchDepth: 1
35-
- checkout: templates
36-
fetchDepth: 1
37-
38-
- task: CopyFiles@1
39-
displayName: Copy NuGet.config
40-
inputs:
41-
sourceFolder: $(Build.SourcesDirectory)/cd
42-
Contents: NuGet.config
43-
TargetFolder: $(Build.SourcesDirectory)/webserver
44-
45-
- task: NuGetToolInstaller@0
46-
displayName: Install specifc version of NuGet
47-
inputs:
48-
versionSpec: '5.4.0'
32+
# step from template @ nf-tools repo
33+
# all build, update and publish steps
34+
- template: azure-pipelines-templates/class-lib-build.yml@templates
35+
parameters:
36+
sonarCloudProject: 'nanoframework_lib-nanoframework.WebServer'
4937

50-
- task: PowerShell@2
51-
displayName: Update dependencies
52-
inputs:
53-
targetType: filePath
54-
filePath: nf-tools/github-actions/update-nf-dependencies.ps1
55-
56-
- task: NuGetCommand@2
57-
displayName: NuGet restore
58-
inputs:
59-
restoreSolution: '$(solution)'
60-
feedsToUse: config
61-
nugetConfigPath: cd/NuGet.config
62-
63-
- task: InstallnFBuildComponents@1
64-
displayName: Install nanoFramework MSBuild components
65-
66-
- task: VSBuild@1
67-
inputs:
68-
solution: '$(solution)'
69-
platform: '$(buildPlatform)'
70-
configuration: '$(buildConfiguration)'
71-
72-
- task: PowerShell@2
73-
displayName: Tweak NuGet package version
74-
inputs:
75-
targetType: 'inline'
76-
script: |
77-
$counter = $env:REVISION
78-
$version = [int]$counter
79-
# preview version
80-
$nugetVersion = "2.4.0-preview."
81-
82-
# stable version
83-
# $nugetVersion = "2.4.0."
84-
85-
86-
$nugetVersion = $nugetVersion + $version.ToString()
87-
Write-Host "$("##vso[task.setvariable variable=NUGET_VERSION]")$nugetVersion"
88-
errorActionPreference: 'stop'
89-
failOnStderr: 'true'
90-
91-
- task: NuGetCommand@2
92-
displayName: Pack NuGet for nanoFramework.WebServer
93-
condition: succeeded()
94-
inputs:
95-
command: 'custom'
96-
arguments: 'pack .\webserver\nuspec\nanoFramework.WebServer.nuspec -Version $(NUGET_VERSION) -BasePath $(Build.SourcesDirectory)\webserver'
97-
98-
- task: CopyFiles@1
99-
displayName: Collecting deployable artifacts
100-
condition: succeeded()
101-
inputs:
102-
sourceFolder: $(Build.SourcesDirectory)
103-
Contents: |
104-
**\nanoFramework.WebServer*.nupkg
105-
TargetFolder: '$(Build.ArtifactStagingDirectory)'
106-
flattenFolders: true
107-
108-
# publish artifacts (only possible if this is not a PR originated on a fork)
109-
- task: PublishBuildArtifacts@1
110-
displayName: Publish deployables artifacts
111-
condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) )
112-
inputs:
113-
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
114-
ArtifactName: deployables
115-
ArtifactType: Container
116-
117-
# push NuGet packages to Azure Artifacts feed (always happens except on PR builds)
118-
- task: NuGetCommand@2
119-
displayName: Push NuGet packages to Azure Artifacts
120-
condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) )
121-
continueOnError: true
122-
inputs:
123-
command: push
124-
nuGetFeedType: external
125-
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
126-
publishFeedCredentials: 'AzureArtifacts-nanowebserver'
127-
allowPackageConflicts: true
128-
129-
# push NuGet packages to MyGet feed (always happens except on PR builds)
130-
- task: NuGetCommand@2
131-
displayName: Push NuGet packages to NuGet
132-
condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) )
133-
continueOnError: true
134-
inputs:
135-
command: push
136-
nuGetFeedType: external
137-
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
138-
publishFeedCredentials: 'NuGet-nanowebserver'
139-
allowPackageConflicts: true
140-
141-
# step from template @ nf-tools repo
142-
# report error
143-
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
144-
parameters:
145-
status: 'failure'
146-
webhookUrl: '$(DiscordWebhook)'
147-
message: ''
38+
# step from template @ nf-tools repo
39+
# report error
40+
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
41+
parameters:
42+
status: 'failure'
43+
webhookUrl: '$(DiscordWebhook)'
44+
message: ''
Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<?xml version="1.0"?>
2-
<package>
2+
<dependency>
33
<metadata>
44
<id>nanoFramework.WebServer</id>
55
<title>WebServer for nanoFramework</title>
6-
<version>0.0.0</version>
6+
<version>$version$</version>
77
<authors>Laurent Ellerbach</authors>
8-
<owners>Laurent Ellerbach</owners>
9-
<licenseUrl>https://github.com/Ellerbach/nanoFramework.WebServer/blob/master/LICENSE</licenseUrl>
10-
<projectUrl>https://github.com/Ellerbach/nanoFramework.WebServer</projectUrl>
8+
<owners>nanoFramework project contributors</owners>
9+
<license type="expression">MIT</license>
10+
<projectUrl>https://github.com/nanoframework/nanoFramework.WebServer</projectUrl>
11+
<iconUrl>https://secure.gravatar.com/avatar/97d0e092247f0716db6d4b47b7d1d1ad</iconUrl>
12+
<icon>images\nf-logo.png</icon>
1113
<requireLicenseAcceptance>false</requireLicenseAcceptance>
14+
<developmentDependency>false</developmentDependency>
1215
<summary>.NET nanoFramework WebServer</summary>
1316
<description>
1417
This is a simple multithread WebServer supporting simple controller and event based
@@ -17,20 +20,24 @@
1720
Supports https and http.
1821
</description>
1922
<releaseNotes></releaseNotes>
20-
<copyright>Copyright 2020</copyright>
23+
<repository type="git" url="https://github.com/nanoframework/nanoFramework.WebServer" commit="$commit$" />
24+
<copyright>Copyright (c) .NET Foundation and Contributors</copyright>
2125
<tags>http https webserver net netmf nf nanoframework</tags>
2226
<dependencies>
2327
<dependency id="nanoFramework.CoreLibrary" version="1.9.1-preview.6" />
24-
<dependency id="nanoFramework.System.Collections" version="1.2.0-preview.14" />
2528
<dependency id="nanoFramework.Runtime.Events" version="1.8.2-preview.10" />
26-
<dependency id="nanoFramework.Windows.Storage.Streams" version="1.10.1-preview.14"/>
27-
<dependency id="nanoFramework.Windows.Storage" version="1.4.4-preview.25" />
28-
<dependency id="nanoFramework.System.Text" version="1.1.1-preview.14" />
29+
<dependency id="nanoFramework.System.Collections" version="1.2.0-preview.14" />
2930
<dependency id="nanoFramework.System.Net" version="1.6.3-preview.15" />
30-
<dependency id="nanoFramework.System.Net.Http" version="1.3.3-preview.23" />
31+
<dependency id="nanoFramework.System.Net.Http.Server" version="1.3.3-preview.27" />
32+
<dependency id="nanoFramework.System.Text" version="1.1.1-preview.14" />
33+
<dependency id="nanoFramework.Windows.Storage" version="1.4.4-preview.25" />
34+
<dependency id="nanoFramework.Windows.Storage.Streams" version="1.10.1-preview.14" />
3135
</dependencies>
3236
</metadata>
3337
<files>
34-
<file src="webserver\nanoFramework.WebServer\bin\Release\nanoFramework.WebServer.*" target="lib" />
38+
<file src="nanoFramework.WebServer\bin\Release\nanoFramework.WebServer.*" target="lib" />
39+
40+
<file src="readme.txt" target="readme.txt" />
41+
<file src="nanoFramework.WebServer\nf-logo.png" target="images\" />
3542
</files>
36-
</package>
43+
</dependency>

WebServer.sln renamed to nanoFramework.WebServer.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.30523.141
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "WebServer", "WebServer\WebServer.nfproj", "{87AAA5FE-CBB6-497F-97B7-7AF21B9A0C4E}"
6+
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "nanoFramework.WebServer", "nanoFramework.WebServer\nanoFramework.WebServer.nfproj", "{87AAA5FE-CBB6-497F-97B7-7AF21B9A0C4E}"
77
EndProject
88
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "WebServer.Sample", "WebServer.Sample\WebServer.Sample.nfproj", "{F8E6E498-9D0D-4941-8B10-0882642F88BA}"
99
EndProject
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)