-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.yml
63 lines (53 loc) · 1.54 KB
/
build.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
trigger:
branches:
include:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- checkout: self
persistCredentials: true
- task: NuGetCommand@2
displayName: Install GitVersion
inputs:
command: custom
arguments: install GitVersion.CommandLine -Version 4.0.0 -OutputDirectory $(Build.BinariesDirectory)/tools -ExcludeVersion
- script: $(Build.BinariesDirectory)/tools/GitVersion.CommandLine/tools/GitVersion.exe /output buildserver /nofetch
displayName: Determine Version
- task: NuGetCommand@2
displayName: NuGet Restore
inputs:
command: restore
restoreSolution: '**/*.sln'
- task: VSBuild@1
displayName: Build
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/p:Version=$(GitVersion.NuGetVersion)'
- task: NuGetCommand@2
displayName: Pack
inputs:
command: pack
packagesToPack: '**/*.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)'
versioningScheme: byEnvVar
versionEnvVar: GITVERSION_NUGETVERSION
- task: PublishPipelineArtifact@1
displayName: Publish NuGet package to pipeline
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/*.nupkg'
artifact: 'NuGetPackages'
publishLocation: 'pipeline'
- task: GitTag@5
displayName: Label Source
inputs:
workingdir: '$(Build.SourcesDirectory)'
tag: 'v$(GitVersion.NuGetVersion)'
env:
SYSTEM_ACCESSTOKEN: '$(System.AccessToken)'