-
Notifications
You must be signed in to change notification settings - Fork 9
/
azure-pipelines.yml
78 lines (63 loc) · 1.94 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
trigger:
- master
stages:
- stage: 'Build'
variables:
buildConfiguration: 'Release'
jobs:
- job:
pool:
vmImage: 'ubuntu-latest'
workspace:
clean: all
steps:
- task: DotNetCoreCLI@2
displayName: "NuGet Restore"
inputs:
command: restore
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: "Build Solution"
inputs:
command: build
projects: '**/*.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: "Run Tests"
inputs:
command: 'test'
projects: 'Uploadcare.Tests/Uploadcare.Tests.csproj'
- task: DotNetCoreCLI@2
displayName: 'Create NuGet Package'
inputs:
command: pack
packDirectory: '$(Build.ArtifactStagingDirectory)/package'
arguments: '--configuration $(buildConfiguration)'
nobuild: true
- publish: '$(Build.ArtifactStagingDirectory)/package'
artifact: 'package'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'XUnit'
testResultsFiles: '**/*.trx'
searchFolder: '$(Agent.TempDirectory)'
- stage: 'PublishReleaseNuGetPackage'
displayName: 'Publish NuGet Package'
dependsOn: 'Build'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- deployment:
pool:
vmImage: 'ubuntu-latest'
environment: 'nugetorg'
strategy:
runOnce:
deploy:
steps:
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.1'
- task: NuGetCommand@2
inputs:
command: 'custom'
arguments: 'push $(Pipeline.Workspace)/package/*.nupkg -NonInteractive -Source https://api.nuget.org/v3/index.json -ApiKey $(nuget-uploadcare) -SkipDuplicate -NoSymbols'