-
Notifications
You must be signed in to change notification settings - Fork 416
/
azure-pipelines.yml
216 lines (206 loc) · 7.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
trigger:
batch: "true"
branches:
include:
- master
- refs/tags/*
pr: none
resources:
repositories:
- repository: rsg
type: github
name: RocketSurgeonsGuild/AzureDevopsTemplates
ref: refs/tags/v0.4.5
endpoint: github
variables:
Verbosity: Diagnostic
DotNetVersion: "8.0.303"
CakeVersion: "3.0.0"
NuGetVersion: "6.5.0"
GitVersionVersion: "5.0.1"
MonoVersion: "6.12.0"
Coverage: "$(Agent.BuildDirectory)/c"
VstsCoverage: "$(Coverage)"
Artifacts: $(Build.SourcesDirectory)/artifacts/
VstsArtifacts: "$(Artifacts)"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "true"
IsMaster: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
IsRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/v')]
IsBetaRelease: $[and(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), contains(variables['Build.SourceBranch'], '-beta.'))]
IsOfficialRelease: $[and(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), not(contains(variables['Build.SourceBranch'], '-beta.')))]
stages:
- stage: CreateBetaReleaseTag
displayName: "Tag Beta Release"
condition: eq(variables.IsMaster, true)
jobs:
- job: GitVersion
pool:
vmImage: "windows-2019"
steps:
- template: gitversion/store.yml@rsg
parameters:
NuGetVersion: $(NuGetVersion)
version: $(GitVersionVersion)
- job: CreateTag
pool:
vmImage: "ubuntu-latest"
dependsOn: GitVersion
steps:
- checkout: self
fetchTags: false
persistCredentials: true
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
- script: |
git tag v$(Build.BuildNumber)
git push --tags
- task: GitHubRelease@1
displayName: "GitHub create beta release"
inputs:
gitHubConnection: "OmniSharp Org"
repositoryName: OmniSharp/omnisharp-roslyn
action: create
tag: "v$(Build.BuildNumber)"
tagSource: gitTag
title: "v$(Build.BuildNumber)"
isDraft: true
isPreRelease: true
addChangeLog: true
- stage: BuildRelease
displayName: "Build Release"
condition: eq(variables.IsRelease, true)
jobs:
- job: GitVersion
pool:
vmImage: "windows-2019"
steps:
- template: gitversion/store.yml@rsg
parameters:
NuGetVersion: $(NuGetVersion)
version: $(GitVersionVersion)
- job: macOS
pool:
vmImage: "macos-12"
dependsOn: GitVersion
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
MonoVersion: $(MonoVersion)
- script: |
echo $PATH
chmod 755 ./build.sh
./build.sh --configuration Release --verbosity Verbose --target CI --publish-all --archive
displayName: "Build"
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: Linux
pool:
vmImage: "ubuntu-20.04"
dependsOn: GitVersion
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
MonoVersion: $(MonoVersion)
- script: |
chmod 755 ./build.sh
./build.sh --configuration Release --verbosity Verbose --target CI --publish-all --archive
displayName: "Build"
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: Windows
pool:
vmImage: "windows-2022"
dependsOn: GitVersion
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
- powershell: .\build.ps1 -configuration Release -verbosity Verbose -target CI --publish-all --archive
displayName: "Build"
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: Release
pool:
vmImage: "ubuntu-latest"
dependsOn:
- macOS
- Linux
- Windows
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
- task: DownloadBuildArtifacts@0
displayName: Download Packages
inputs:
downloadType: "single"
artifactName: "packages"
buildType: "current"
downloadPath: "$(System.ArtifactsDirectory)"
- task: DownloadBuildArtifacts@0
displayName: Download Deployment
inputs:
downloadType: "single"
artifactName: "deployment"
buildType: "current"
downloadPath: "$(System.ArtifactsDirectory)"
- task: DownloadBuildArtifacts@0
displayName: Download NuGet
inputs:
downloadType: "single"
artifactName: "nuget"
buildType: "current"
downloadPath: "$(System.ArtifactsDirectory)"
- task: NuGetCommand@2
displayName: "Push NuGet packages to Azure Artifacts"
inputs:
command: push
nuGetFeedType: internal
packagesToPush: "$(System.ArtifactsDirectory)/nuget/**/*.nupkg"
publishVstsFeed: Builds/omnisharp
allowPackageConflicts: true
- task: NuGetCommand@2
displayName: "Push NuGet packages to nuget.org"
inputs:
command: push
nuGetFeedType: external
packagesToPush: "$(System.ArtifactsDirectory)/nuget/**/*.nupkg"
publishFeedCredentials: nuget.org
allowPackageConflicts: true
condition: and(succeeded(), eq(variables.IsOfficialRelease, true))
- task: GitHubRelease@1
displayName: "GitHub release (edit)"
inputs:
gitHubConnection: "OmniSharp Org"
repositoryName: OmniSharp/omnisharp-roslyn
action: edit
tag: "$(Build.SourceBranchName)"
title: "$(Build.SourceBranchName)"
assets: "$(System.ArtifactsDirectory)/packages/**/*"
assetUploadMode: replace
# releaseNotesSource: input
# releaseNotes: asdfasdf12
# isDraft: true
isPreRelease: $(IsBetaRelease)
# addChangeLog: false