-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
189 lines (164 loc) · 5.54 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
trigger:
- master
# no PR triggers
pr: none
variables:
theLatestVersion: ''
artifactName: entry-angular-building-blocks
peerDependencies.@enigmatry/entry-components: $(theLatestVersion)
stages:
- stage: ci_build
displayName: Build the Angular Building Blocks
jobs:
- job: build
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
fetchDepth: 50
fetchTags: true
- task: DotNetCoreCLI@2
displayName: Add Manifest for tool installation
inputs:
command: 'custom'
custom: 'new '
arguments: tool-manifest
- task: DotNetCoreCLI@2
displayName: Install minver
inputs:
command: 'custom'
custom: 'tool '
arguments: install minver-cli
- task: PowerShell@2
displayName: 'Set MinVer Version'
inputs:
targetType: inline
script: |
$version = dotnet minver -p preview
echo "##vso[task.setvariable variable=theLatestVersion]$version"
echo "##vso[build.updatebuildnumber]$version"
Write-Host "Setting MinVer to '$version'"
- task: Npm@1
displayName: 'Set the version for entry form'
inputs:
command: custom
customCommand: version $(theLatestVersion) --no-git-tag-version
workingDir: 'libs/entry-form'
- task: Npm@1
displayName: 'Set the version for entry components'
inputs:
command: custom
customCommand: version $(theLatestVersion) --no-git-tag-version
workingDir: 'libs/entry-components'
- task: Npm@1
displayName: 'Set the version eslint recommended rules'
inputs:
command: custom
customCommand: version $(theLatestVersion) --no-git-tag-version
workingDir: 'libs/eslint-config'
- task: Npm@1
displayName: 'Set the version stylelint recommended rules'
inputs:
command: custom
customCommand: version $(theLatestVersion) --no-git-tag-version
workingDir: 'libs/stylelint-config'
- task: Npm@1
displayName: 'Set the version scss foundation'
inputs:
command: custom
customCommand: version $(theLatestVersion) --no-git-tag-version
workingDir: 'libs/scss-foundation'
- task: Npm@1
displayName: 'npm ci'
inputs:
command: 'ci'
- task: Npm@1
displayName: 'Lint libraries'
inputs:
command: 'custom'
customCommand: 'run lint'
- task: Npm@1
displayName: 'Build entry components'
inputs:
command: 'custom'
customCommand: 'run build @enigmatry/entry-components'
- task: Npm@1
displayName: 'Build entry form'
inputs:
command: 'custom'
customCommand: 'run build @enigmatry/entry-form'
- task: Npm@1
displayName: 'Run unit tests'
inputs:
command: 'custom'
customCommand: 'run automated-tests'
- task: FileTransform@2
displayName: 'File transformation: package.json'
inputs:
folderPath: 'dist'
jsonTargetFiles: '**/package.json'
xmlTransformationRules:
- task: PublishBuildArtifacts@1
displayName: Publish artifacts
inputs:
PathtoPublish: 'dist'
ArtifactName: $(artifactName)-$(Build.BuildNumber)
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
displayName: Publish libs
inputs:
PathtoPublish: 'libs'
ArtifactName: $(artifactName)-$(Build.BuildNumber)
publishLocation: 'Container'
- stage: publish_npm
dependsOn: ci_build
displayName: Publish to NPM
jobs:
- deployment: Deploy
environment: npm
pool:
vmImage: ubuntu-latest
strategy:
runOnce:
deploy:
steps:
- checkout: self
fetchDepth: 50
fetchTags: true
- download: current
displayName: 'Download build artifacts'
- task: Npm@1
displayName: 'Publish entry form'
inputs:
command: publish
publishRegistry: useExternalRegistry
publishEndpoint: npm
workingDir: '$(Pipeline.Workspace)/$(artifactName)-$(Build.BuildNumber)/enigmatry/entry-form'
- task: Npm@1
displayName: 'Publish entry components'
inputs:
command: publish
publishRegistry: useExternalRegistry
publishEndpoint: npm
workingDir: '$(Pipeline.Workspace)/$(artifactName)-$(Build.BuildNumber)/enigmatry/entry-components'
- task: Npm@1
displayName: 'Publish the eslint recommended rules'
inputs:
command: publish
publishRegistry: useExternalRegistry
publishEndpoint: npm
workingDir: '$(Pipeline.Workspace)/$(artifactName)-$(Build.BuildNumber)/eslint-config'
- task: Npm@1
displayName: 'Publish the stylelint recommended rules'
inputs:
command: publish
publishRegistry: useExternalRegistry
publishEndpoint: npm
workingDir: '$(Pipeline.Workspace)/$(artifactName)-$(Build.BuildNumber)/stylelint-config'
- task: Npm@1
displayName: 'Publish the scss foundation'
inputs:
command: publish
publishRegistry: useExternalRegistry
publishEndpoint: npm
workingDir: '$(Pipeline.Workspace)/$(artifactName)-$(Build.BuildNumber)/scss-foundation'