Skip to content

Commit 80b97ef

Browse files
Ellerbachjosesimoes
authored andcommitted
Adding pipelines and nuget config
1 parent df34163 commit 80b97ef

File tree

3 files changed

+190
-0
lines changed

3 files changed

+190
-0
lines changed

NuGet.Config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="NuGet" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
<add key="Azure Artifacts nanoFramework dev" value="https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json" protocolVersion="3" />
6+
</packageSources>
7+
</configuration>

azure-pipelines.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# no trigger config here, this is handled at Azure Pipelines interface
2+
3+
# add nf-tools repo to resources (for Azure Pipelines templates)
4+
resources:
5+
repositories:
6+
- repository: templates
7+
type: github
8+
name: nanoframework/nf-tools
9+
endpoint: nfbot
10+
- repository: webserver
11+
type: github
12+
endpoint: ellerbach
13+
name: ellerbach/nanoFramework.Webserver
14+
ref: master
15+
16+
pool:
17+
vmImage: 'VS2017-Win2016'
18+
19+
variables:
20+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
21+
solution: './webserver/WebServer.sln'
22+
buildPlatform: 'Any CPU'
23+
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+
28+
steps:
29+
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'
49+
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: ''
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0"?>
2+
<package>
3+
<metadata>
4+
<id>nanoFramework.WebServer</id>
5+
<title>WebServer for nanoFramework</title>
6+
<version>0.0.0</version>
7+
<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>
11+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<summary>.NET nanoFramework WebServer</summary>
13+
<description>
14+
This is a simple multithread WebServer supporting simple controller and event based
15+
calls. Perfect for nanoFramework REST API based project. Support all type of Http Methods.
16+
Perfect for simple embedded web pages, with Support of file on a storage (USB, SD Card, in Memory).
17+
Supports https and http.
18+
</description>
19+
<releaseNotes></releaseNotes>
20+
<copyright>Copyright 2020</copyright>
21+
<tags>http https webserver net netmf nf nanoframework</tags>
22+
<dependencies>
23+
<dependency id="nanoFramework.CoreLibrary" version="1.9.1-preview.6" />
24+
<dependency id="nanoFramework.System.Collections" version="1.2.0-preview.14" />
25+
<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.Net" version="1.6.3-preview.15" />
30+
<dependency id="nanoFramework.System.Net.Http" version="1.3.3-preview.23" />
31+
</dependencies>
32+
</metadata>
33+
<files>
34+
<file src="webserver\nanoFramework.WebServer\bin\Release\nanoFramework.WebServer.*" target="lib" />
35+
</files>
36+
</package>

0 commit comments

Comments
 (0)