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)
412resources :
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
1619pool :
1720 vmImage : ' VS2017-Win2016'
1821
1922variables :
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
2830steps :
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 : ' '
0 commit comments