-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathazure-pipelines.yml
116 lines (89 loc) · 3.28 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
variables:
buildConfiguration: 'Release'
trigger:
branches:
include:
- master
tags:
include:
- 'v*'
pr:
branches:
include:
- master
pool:
vmImage: ubuntu-latest
steps:
- task: gitversion/setup@0
displayName: 'Install GitVersion'
inputs:
versionSpec: 5.x
- task: GitVersion/execute@0
displayName: 'Determine build version'
name: GitVersion
- task: Npm@1
displayName: 'Install npx'
inputs:
command: custom
customCommand: 'install nx'
verbose: false
- task: Npm@1
displayName: 'Update extension package version'
inputs:
command: custom
customCommand: 'version $(GitVersion.SemVer) --git-tag-version false'
- task: Npm@1
displayName: 'npm install'
inputs:
command: ci
workingDir: $(Build.SourcesDirectory)
# TODO: Rather than build language server as part of extension CI, check the last commit in history for repo @ ./lib/server that is associated with a GitHub release and download the appropriate language server artifact from there.
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
projects: './lib/server/MSBuildProjectTools.sln'
restoreArguments: '/p:VersionPrefix="$(GitVersion.MajorMinorPatch)" /p:VersionSuffix="$(GitVersion.PreReleaseTag)"'
- task: DotNetCoreCLI@2
displayName: 'Build solution'
inputs:
command: 'build'
projects: './lib/server/MSBuildProjectTools.sln'
arguments: '--configuration "$(buildConfiguration)" /p:VersionPrefix="$(GitVersion.MajorMinorPatch)" /p:VersionSuffix="$(GitVersion.PreReleaseTag)"'
- task: DotNetCoreCLI@2
displayName: 'Run tests'
inputs:
command: 'test'
projects: './lib/server/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: './lib/server/src/LanguageServer/LanguageServer.csproj'
arguments: '--configuration "$(buildConfiguration)" -o "./language-server" /p:VersionPrefix="$(GitVersion.MajorMinorPatch)" /p:VersionSuffix="$(GitVersion.PreReleaseTag)"'
modifyOutputPath: false
zipAfterPublish: false
- script: npx vsce package -o "$(Build.ArtifactStagingDirectory)/msbuild-project-tools-vscode-$(GitVersion.SemVer).vsix"
displayName: 'Build VS Code extension package'
- task: PublishBuildArtifacts@1
displayName: 'Publish extension package'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/msbuild-project-tools-vscode-$(GitVersion.SemVer).vsix'
ArtifactName: 'vscode-extension'
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%\.]+)?$'
releaseNotesFilePath: $(Build.SourcesDirectory)/CHANGELOG.md
addChangeLog: false
assets: '$(Build.ArtifactStagingDirectory)/*.vsix'
assetUploadMode: replace