-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines-nuget.yml
58 lines (51 loc) · 1.79 KB
/
azure-pipelines-nuget.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Azure Pipelines for NuGet :)
# More info: https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=vsts
parameters:
Name: 'ContosoCognitivePipelineClientSDK'
RestoreBuildProjects: '**/*.ClientSDK.csproj'
WorkingDirectory: 'Src/Backend/CognitivePipeline.ClientSDK'
BuildConfiguration: 'Release'
Major: '1'
Minor: '0'
jobs:
- job: ${{ Parameters.Name }}
pool:
vmImage: 'vs2017-win2016'
demands: npm
steps:
- task: DotNetCoreCLI@2
displayName: DotNet Restore
inputs:
command: restore
projects: ${{ Parameters.RestoreBuildProjects }}
- task: DotNetCoreCLI@2
displayName: DotNet Build
inputs:
command: build
projects: ${{ Parameters.RestoreBuildProjects }}
arguments: '--configuration ${{ Parameters.BuildConfiguration }}'
workingDirectory: ${{ Parameters.WorkingDirectory }}
- task: DotNetCoreCLI@2
displayName: 'DotNet Pack'
inputs:
command: pack
packagesToPack: '${{ Parameters.RestoreBuildProjects }}'
configuration: '$(BuildConfiguration)'
packDirectory: '$(Build.ArtifactStagingDirectory)'
nobuild: true
versioningScheme: byPrereleaseNumber
majorVersion: '${{ Parameters.Major }}'
minorVersion: '${{ Parameters.Minor }}'
patchVersion: '$(Build.BuildId)'
# - task: NuGetCommand@2
# displayName: 'NuGet push'
# inputs:
# command: push
# packagesToPush: '**/Contoso.CognitivePipeline.ClientSDK.*.nupkg;**/Contoso.CognitivePipeline.ClientSDK.*.symbols.nupkg'
# publishVstsFeed: '$(azureArtifactFeedId)'
# allowPackageConflicts: true
- task: PublishBuildArtifacts@1
displayName: 'Publish NuGet Artifact: ${{ Parameters.Name }}'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'CognitivePipeline-ClientSDK'