11trigger :
2- branches :
3- include : ["master", "*"]
42 paths :
5- exclude : ["doc", "*.md", ".appveyor.yml"]
3+ exclude :
4+ - " doc"
5+ - " *.md"
6+ - " .appveyor.yml"
67
7- pr :
8- branches :
9- include : [ "*" ]
8+ # add nf-tools repo to resources (for Azure Pipelines templates)
9+ resources :
10+ repositories :
11+ - repository : templates
12+ type : github
13+ name : nanoframework/nf-tools
14+ endpoint : nfbot
1015
1116pool :
1217 vmImage : ' VS2017-Win2016'
@@ -15,8 +20,14 @@ variables:
1520 solution : ' **/source/*.sln'
1621 buildPlatform : ' Any CPU'
1722 buildConfiguration : ' Release'
23+ nugetPackageName : ' nanoFramework.Networking.Sntp'
1824
1925steps :
26+
27+ # need this here in order to persist GitHub credentials
28+ - checkout : self
29+ persistCredentials : true
30+
2031- task : NuGetToolInstaller@0
2132
2233- task : NuGetCommand@2
@@ -25,34 +36,10 @@ steps:
2536 feedsToUse : config
2637 nugetConfigPath : source/NuGet.config
2738
28- - task : DotNetCoreCLI@2
29- inputs :
30- command : custom
31- custom : tool
32- arguments : install --tool-path . nbgv
33- displayName : Install NBGV tool
39+ - template : azure-pipelines-templates/nb-gitversioning.yml@templates
3440
35- - script : nbgv cloud -p "source"
36- displayName : Set build number
37- condition : ne(variables['system.pullrequest.isfork'], true)
38-
39- # install nanoFramework VS extension
40- - task : PowerShell@2
41- inputs :
42- filePath : ' install-nf-vs-extension.ps1'
43- errorActionPreference : ' stop'
44-
45- # # Batch Script
46- # - task: BatchScript@1
47- # inputs:
48- # filename: '$(INSTALLER_PATH)'
49-
50- # # Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
51- # - task: CmdLine@2
52- # inputs:
53- # script: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe" /q D:\a\_temp\nanoFramework.Tools.VS2017.Extension.vsix'
54- # #workingDirectory: # Optional
55- # #failOnStderr: false # Optional
41+ - task : InstallnFBuildComponents@1
42+ displayName : Install nanoFramework MSBuild components
5643
5744- task : VSBuild@1
5845 inputs :
@@ -66,24 +53,46 @@ steps:
6653# platform: '$(buildPlatform)'
6754# configuration: '$(buildConfiguration)'
6855
56+ - task : NuGetCommand@2
57+ inputs :
58+ command : ' custom'
59+ arguments : ' pack source\$(nugetPackageName).nuspec -Version 1.0.2-preview-020'
60+ displayName : Pack NuGet with class library
61+
6962- task : CopyFiles@1
7063 inputs :
71- sourceFolder : $(System.DefaultWorkingDirectory )
64+ sourceFolder : $(Build.SourcesDirectory )
7265 Contents : |
73- **source\Nuget.*\ *.nupkg
74- TargetFolder : $(Build.ArtifactStagingDirectory)/deployables
66+ **\$(nugetPackageName) *.nupkg
67+ TargetFolder : ' $(Build.ArtifactStagingDirectory)'
7568 flattenFolders : true
69+ condition : and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
7670 displayName : Collecting deployable artifacts
7771
7872- task : PublishBuildArtifacts@1
7973 inputs :
80- PathtoPublish : $(Build.ArtifactStagingDirectory)/deployables
74+ PathtoPublish : ' $(Build.ArtifactStagingDirectory)'
8175 ArtifactName : deployables
8276 ArtifactType : Container
77+ condition : and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
8378 displayName : Publish deployables artifacts
8479
80+ # push NuGet packages to MyGet feed (always happens except on PR builds)
8581- task : NuGetCommand@2
8682 inputs :
8783 command : push
8884 nuGetFeedType : external
85+ packagesToPush : ' $(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
8986 publishFeedCredentials : ' MyGet'
87+ condition : and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
88+ displayName : Push NuGet packages to MyGet
89+
90+ # push NuGet packages to NuGet (happens on tag builds for any branch)
91+ - task : NuGetCommand@2
92+ inputs :
93+ command : push
94+ nuGetFeedType : external
95+ packagesToPush : ' $(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
96+ publishFeedCredentials : ' NuGet'
97+ condition : and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'tags') )
98+ displayName : Push NuGet packages to NuGet
0 commit comments