-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
69 lines (61 loc) · 1.64 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
tags:
include:
- v*
variables:
buildConfiguration: 'Release'
stages:
- stage: Build
jobs:
- job: Test_Build
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
pool:
vmImage: 'windows-2019'
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
- job: Build_Nupkg
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
pool:
vmImage: 'windows-2019'
steps:
- powershell: 'echo "##vso[task.setvariable variable=PackageVersion]$($env:Build_SourceBranchName.Substring(1))"'
displayName: 'PowerShell Script'
- task: DotNetCoreCLI@2
displayName: 'dotnet pack'
inputs:
command: pack
packagesToPack: 'src/**/*.csproj'
packDirectory: '$(System.DefaultWorkingDirectory)/dist'
versioningScheme: byEnvVar
versionEnvVar: PackageVersion
verbosityPack: Normal
- publish: dist
artifact: nupkg
displayName: 'Publish artifacts'
- stage: Publish
dependsOn:
- Build
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
jobs:
- job: Publish_Nupkg
pool:
vmImage: 'windows-2019'
steps:
- checkout: none
- download: current
artifact: nupkg
displayName: 'Download artifact'
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: NuGet.org
verbosityPush: Normal