forked from OmniSharp/omnisharp-roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
198 lines (190 loc) · 7.14 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
trigger:
batch: true
branches:
include:
- master
- refs/tags/*
pr:
autoCancel: true
branches:
include:
- master
resources:
repositories:
- repository: rsg
type: github
name: RocketSurgeonsGuild/AzureDevopsTemplates
ref: refs/tags/v0.4.5
endpoint: github
variables:
Verbosity: Diagnostic
DotNetVersion: "3.0.100"
CakeVersion: "0.32.1"
NuGetVersion: "4.9.2"
GitVersionVersion: "5.0.1"
Coverage: "$(Agent.BuildDirectory)/c"
VstsCoverage: "$(Coverage)"
Artifacts: $(Build.SourcesDirectory)/artifacts/
VstsArtifacts: "$(Artifacts)"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "true"
jobs:
- job: GitVersion
pool:
vmImage: "VS2017-Win2016"
steps:
- template: gitversion/store.yml@rsg
parameters:
NuGetVersion: $(NuGetVersion)
version: $(GitVersionVersion)
- job: macOS
pool:
vmImage: "macOS-10.13"
dependsOn: GitVersion
variables:
MONO_VERSION: 6.4.0
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
- script: |
curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.198.macos10.xamarin.universal.pkg
sudo installer -pkg mono.pkg -target /
sudo cp -rf /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/ /Library/Frameworks/Mono.framework/Versions/Current/
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION
echo "##vso[task.setvariable variable=DYLD_FALLBACK_LIBRARY_PATH;]$MONOPREFIX/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH"
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
displayName: Use Mono $(MONO_VERSION)
failOnStderr: false
- script: |
echo $PATH
chmod 755 ./build.sh
./build.sh --configuration Release --verbosity Verbose --target All --publish-all --archive
displayName: 'Build'
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: Linux
pool:
vmImage: "Ubuntu-16.04"
dependsOn: GitVersion
variables:
MONO_VERSION: 6.4.0
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
- script: |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt install apt-transport-https ca-certificates
echo "deb https://download.mono-project.com/repo/ubuntu vs-xenial/snapshots/6.4.0.198 main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install mono-devel
sudo apt install msbuild
displayName: Use Mono $(MONO_VERSION)
- script: |
chmod 755 ./build.sh
./build.sh --configuration Release --verbosity Verbose --target All --publish-all --archive
displayName: 'Build'
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: Windows
pool:
vmImage: "VS2017-Win2016"
dependsOn: GitVersion
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
- powershell: .\build.ps1 -configuration Release -verbosity Verbose -target All -publish-all -archive
displayName: 'Build'
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: Release
pool:
vmImage: "Ubuntu-16.04"
dependsOn:
- macOS
- Linux
- Windows
steps:
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
inputs:
versionSpec: $(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 myget.org'
inputs:
command: push
nuGetFeedType: external
packagesToPush: '$(System.ArtifactsDirectory)/nuget/**/*.nupkg'
publishFeedCredentials: myget.org
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
- task: NuGetCommand@2
displayName: 'Push NuGet packages to nuget.org'
inputs:
command: push
nuGetFeedType: external
packagesToPush: '$(System.ArtifactsDirectory)/nuget/**/*.nupkg'
publishFeedCredentials: nuget.org
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- script: |
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \
sudo tee /etc/apt/sources.list.d/azure-cli.list
curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-get install apt-transport-https
sudo apt-get update && sudo apt-get install azure-cli
az storage blob upload-batch --destination "releases" --source "$(System.ArtifactsDirectory)/deployment/" --account-name roslynomnisharp --account-key $BLOB_KEY
displayName: Upload to Azure Storage
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
env:
BLOB_KEY: $(BLOB_KEY)
- task: GitHubRelease@0
displayName: 'GitHub release (edit)'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
inputs:
gitHubConnection: github
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: true
# addChangeLog: false