-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
86 lines (82 loc) · 2.37 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
86
trigger:
branches:
include:
- main
- feature/*
pr:
- main
pool:
vmImage: ubuntu-latest
stages:
- stage: build
displayName: Build
jobs:
- job: Build
steps:
- checkout: self
fetchDepth: 0
- task: gitversion/setup@0
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
displayName: Determine GitVersion
inputs:
useConfigFile: true
configFilePath: $(Build.SourcesDirectory)/GitVersion.yml
targetPath: $(Build.SourcesDirectory)
- task: DotNetCoreCLI@2
displayName: Dotnet Restore
inputs:
command: "restore"
projects: |
**/*.csproj
feedsToUse: "select"
includeNuGetOrg: true
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: "test"
projects: |
**/*.csproj
- task: DotNetCoreCLI@2
displayName: Package
inputs:
command: "pack"
versioningScheme: byEnvVar
versionEnvVar: NuGetVersion
packDestination: $(Build.ArtifactStagingDirectory)/package
arguments: "-o $(Build.ArtifactStagingDirectory)/package"
projects: |
**/*.csproj
- task: PublishBuildArtifacts@1
displayName: Publish Build Artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- stage: Deploy
displayName: Deploy
jobs:
- job: Deploy
condition:
or(
in(variables['Build.SourceBranch'], 'refs/heads/main'),
in(variables['Build.Reason'], 'Manual')
)
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download artifacts'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
itemPattern:
downloadPath: '$(System.ArtifactsDirectory)'
- task: NuGetCommand@2
displayName: Publish package to nuget.org using ASOS organisation account
inputs:
command: 'push'
packagesToPush: '$(System.ArtifactsDirectory)/drop/*.nupkg;!$(System.ArtifactsDirectory)/drop/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'ASOS nuget.org feed'