-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
83 lines (73 loc) · 2.24 KB
/
azure-pipelines.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
project: '**/AdCodicem.SpecFlow.MicrosoftDependencyInjection.csproj'
testProject: '**/Sample.Specs.csproj'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
stages:
- stage: build
jobs:
- job:
steps:
- task: UseDotNet@2
displayName: dotnet 3.1 install
inputs:
version: '3.1.x'
packageType: runtime
- task: DotNetCoreCLI@2
displayName: dotnet restore
inputs:
command: 'restore'
projects: '$(solution)'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: 'build'
projects: '$(solution)'
arguments: '--no-restore --configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: 'test'
projects: '$(testProject)'
arguments: '--no-restore --no-build --configuration $(buildConfiguration) --collect "Code Coverage"'
- task: DotNetCoreCLI@2
displayName: dotnet pack
inputs:
command: 'pack'
packagesToPack: '$(project)'
arguments: '--output "$(Build.ArtifactStagingDirectory)"'
nobuild: true
includesymbols: true
versioningScheme: 'off'
- task: PublishBuildArtifacts@1
displayName: Publish artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- stage: release
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
dependsOn: build
jobs:
- job:
steps:
- task: DownloadBuildArtifacts@0
displayName: Download artifacts
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(System.ArtifactsDirectory)'
- task: NuGetCommand@2
displayName: Push nuget
inputs:
command: 'push'
packagesToPush: '$(System.ArtifactsDirectory)/**/*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'Nuget.org'