forked from slunyakin-zz/parquet-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
148 lines (129 loc) Β· 3.95 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
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- README.md
- /doc/**/*
pr:
branches:
include:
- master
paths:
exclude:
- README.md
- /doc/**/*
variables:
- group: 'External Resources'
- name: vmImage
value: 'ubuntu-16.04' # see https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml&viewFallbackFrom=vsts
stages:
- stage: Build
jobs:
- job: Core
displayName: 'Core Build'
pool:
vmImage: $(vmImage)
steps:
- task: petersendev.dotnet-global-tool-installer.DotnetGlobalToolInstaller.DotnetGlobalToolInstaller@0
displayName: 'install housework'
inputs:
name: housework
- script: 'housework author src/*.csproj -s build.ini -r'
displayName: 'author projects'
- script: 'housework substitute ./src/Parquet/ThriftFooter.cs -s build.ini -r'
displayName: 'subst sources'
- script: 'housework setbuildnumber %Version% -s build.ini'
displayName: 'set build number'
- script: 'housework pushvars Version -s build.ini'
displayName: 'push variables'
# init SonarCloud
#- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1
# displayName: 'Prepare analysis on SonarCloud'
# inputs:
# SonarCloud: SonarCloud
# organization: aloneguid-github
# projectKey: parquet_dotnet
# projectName: 'Parquet.Net'
# projectVersion: '$(Version)'
- task: DotNetCoreCLI@2
displayName: 'build all'
inputs:
projects: src/Parquet.sln
arguments: '-c release'
#- task: DotNetCoreCLI@2
# displayName: 'Integration and Unit Test'
# continueOnError: true
# inputs:
# command: test
# projects: ./src/Parquet.sln
# arguments: '-c release'
- task: CopyFiles@2
displayName: 'copy generated nugets'
inputs:
SourceFolder: src
Contents: '**/*.nupkg'
TargetFolder: ' $(build.artifactstagingdirectory)'
CleanTargetFolder: true
OverWrite: true
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'publish nugets'
inputs:
ArtifactName: nuget
# finish Sonar analysis
#- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1
# displayName: 'SonarQube: Run Code Analysis'
#- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1
# displayName: 'SonarQube: Publish Quality Gate Result'
- stage: Test
#condition: succeeded('Build')
dependsOn: [] # remove explicit dependency, so it runs in parallel
jobs:
- job: Platform
displayName: 'on'
strategy:
matrix:
Windows:
image: 'windows-2019'
Linux:
image: 'ubuntu-16.04'
MacOSX:
image: 'macOS-10.14'
pool:
vmImage: $(image)
steps:
- task: DotNetCoreCLI@2
displayName: 'run tests'
inputs:
command: test
projects: ./src/Parquet.sln
arguments: '-c release'
- stage: Release
dependsOn: ['Build', 'Test']
condition: "and( eq(variables['Build.SourceBranch'], 'refs/heads/master'), succeeded('Build'), succeeded('Test') )"
jobs:
- deployment: NugetOrg
displayName: 'nuget.org public feed'
pool:
vmImage: $(vmImage)
environment: live
strategy:
runOnce:
deploy:
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'nuget'
downloadPath: '$(System.ArtifactsDirectory)'
- task: NuGetCommand@2
displayName: nuget.org
inputs:
command: push
packagesToPush: '$(System.ArtifactsDirectory)/nuget/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'nuget.org (aloneguid)'