-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
azure-pipelines.yml
85 lines (79 loc) · 2.29 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
84
85
variables:
Major: 9
Minor: 0
Revision: 0
BuildConfiguration: Release
name: $(Major).$(Minor).$(Revision)
pr: none
trigger:
batch: true
tags:
include:
- refs/tags/*
paths:
exclude:
- examples/*
- README.md
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo Build Number $(name)
- task: UseDotNet@2
displayName: 'Use .NET 8.0 sdk'
inputs:
packageType: sdk
version: 9.0.100
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: echo Started restoring the source code
- task: DotNetCoreCLI@2
displayName: 'Restoring'
inputs:
command: 'restore'
projects: '**/Xunit.Microsoft.DependencyInjection.csproj'
feedsToUse: 'select'
- script: echo Started building the source code
- task: DotNetCoreCLI@2
displayName: 'Building'
inputs:
command: 'build'
projects: '**/Xunit.Microsoft.DependencyInjection.csproj'
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Running tests in example folder'
continueOnError: true
inputs:
command: 'test'
projects: '**/examples/Xunit.Microsoft.DependencyInjection.ExampleTests'
arguments: '--configuration $(BuildConfiguration)'
testRunTitle: 'Running sample tests'
- script: echo Started publishing
- task: DotNetCoreCLI@2
displayName: 'Publishing'
inputs:
command: 'publish'
publishWebProjects: false
projects: '**/Xunit.Microsoft.DependencyInjection.csproj'
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
- script: echo Started dropping
- task: PublishBuildArtifacts@1
displayName: 'Dropping'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- script: echo Started packing and pushing
- task: NuGetCommand@2
displayName: 'Packing'
inputs:
command: 'pack'
packagesToPack: '**/Xunit.Microsoft.DependencyInjection.csproj'
versioningScheme: 'byEnvVar'
versionEnvVar: 'Build.BuildNumber'
- task: NuGetCommand@2
displayName: 'Pushing to nuget.org'
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'NuGet'
allowPackageConflicts: true