-
Notifications
You must be signed in to change notification settings - Fork 16
/
azure-pipelines.yml
99 lines (77 loc) · 2.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
trigger:
branches:
include:
- master
tags:
include:
- 'v*'
pr:
branches:
include:
- master
pool:
vmImage: ubuntu-latest
variables:
buildConfiguration: 'Release'
steps:
- task: gitversion/setup@0
displayName: 'Install GitVersion'
inputs:
versionSpec: 5.x
- task: GitVersion/execute@0
displayName: 'Determine build version'
name: GitVersion
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
projects: './MSBuildProjectTools.sln'
restoreArguments: '/p:VersionPrefix="$(GitVersion.MajorMinorPatch)" /p:VersionSuffix="$(GitVersion.PreReleaseTag)"'
- task: DotNetCoreCLI@2
displayName: 'Build solution'
inputs:
command: 'build'
projects: './MSBuildProjectTools.sln'
arguments: '--configuration "$(buildConfiguration)" /p:VersionPrefix="$(GitVersion.MajorMinorPatch)" /p:VersionSuffix="$(GitVersion.PreReleaseTag)"'
- task: DotNetCoreCLI@2
displayName: 'Run tests'
inputs:
command: 'test'
projects: './test/LanguageServer.Engine.Tests/LanguageServer.Engine.Tests.csproj'
arguments: '--configuration "$(buildConfiguration)" /p:VersionPrefix="$(GitVersion.MajorMinorPatch)" /p:VersionSuffix="$(GitVersion.PreReleaseTag)"'
- task: DotNetCoreCLI@2
displayName: 'Publish language server'
inputs:
command: 'publish'
publishWebProjects: false
projects: './src/LanguageServer/LanguageServer.csproj'
arguments: '--configuration "$(buildConfiguration)" -o "./out/language-server" /p:VersionPrefix="$(GitVersion.MajorMinorPatch)" /p:VersionSuffix="$(GitVersion.PreReleaseTag)"'
modifyOutputPath: false
zipAfterPublish: false
- task: ArchiveFiles@2
displayName: 'Package language-server artifact'
inputs:
rootFolderOrFile: './out/language-server'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/language-server.zip'
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
displayName: 'Publish language-server artifact'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/language-server.zip'
ArtifactName: 'language-server'
publishLocation: 'Container'
- task: GitHubRelease@1
displayName: 'Create GitHub release from tag'
condition: contains(variables['Build.SourceBranch'], 'refs/tags/v')
inputs:
gitHubConnection: 'github.com_tintoy'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'gitTag'
tagPattern: '^v\d+\.\d+.\d+(-[A-Za-z0-9%\.]+)?$'
addChangeLog: true
assets: '$(Build.ArtifactStagingDirectory)/*.zip'
assetUploadMode: replace