-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
69 lines (60 loc) · 2.38 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
trigger:
branches:
include:
- master
paths:
# NB: It's currently shorter to use an include list instead of an exclude list
include:
- src/
- Marqeta.Core.Abstractions.sln
- GitVersion.yml
- azure-pipelines.yml
exclude:
- src/Marqeta.Core.Abstractions.Tests/
pr:
branches:
include:
- master
pool:
vmImage: 'ubuntu-18.04'
variables:
buildConfiguration: 'Release'
gitVersionVersion: '5.1.3'
nuGetServiceConnectionName: 'nuget.org'
githubServiceConnectionName: 'CapitalOnTap'
steps:
- task: GitVersion@5
displayName: 'Run GitVersion'
inputs:
useConfigFile: true
configFilePath: GitVersion.yml
- script: dotnet build --configuration $(buildConfiguration) /p:Version='$(GitVersion.NuGetVersion)'
displayName: 'dotnet build $(buildConfiguration)'
- script: dotnet test --configuration $(buildConfiguration) --no-build --logger "trx;LogFileName=$(Common.TestResultsDirectory)\TestResults.xml"
displayName: 'dotnet test $(buildConfiguration)'
condition: and(succeeded(), ne('true', variables['SKIP_TESTS']))
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '$(Common.TestResultsDirectory)/*.xml'
condition: and(succeeded(), ne('true', variables['SKIP_TESTS']))
- script: dotnet pack --configuration $(buildConfiguration) --no-build /p:Version='$(GitVersion.NuGetVersion)' -o '$(build.artifactStagingDirectory)'
displayName: 'dotnet pack $(buildConfiguration)'
- task: NuGetCommand@2
inputs:
command: 'push'
nuGetFeedType: external
publishFeedCredentials: $(nuGetServiceConnectionName)
# We only want to do this if this is a master branch build OR we have set the FORCE_PUSH_NUGET variable.
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('true', variables['FORCE_PUSH_NUGET'])))
displayName: 'Push NuGet package(s)'
#
# NB: This is temporarily disabled as it doesn't work with Linux agents
#
# - task: KriefMikael.githubtools.GitHubTag.GitHubTag@1
# inputs:
# githubEndpoint: $(githubServiceConnectionName)
# tag: 'v$(GitVersion.NuGetVersion)'
# # We only want to do this if this is a master branch build OR we have set the FORCE_PUSH_NUGET variable.
# condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('true', variables['FORCE_PUSH_NUGET'])))
# displayName: "Create tag in GitHub"