Skip to content

Commit 6f4af7c

Browse files
committed
Work CI-CD
- Rework conditions. - Remove build on tags.
1 parent d57089a commit 6f4af7c

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

azure-pipelines.yml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ trigger:
2020
- assets/*
2121
- config/*
2222
- .github/*
23-
tags:
24-
include:
25-
- refs/tags/v*
2623

2724
# PR always trigger build
2825
pr:
@@ -181,7 +178,6 @@ jobs:
181178
buildConfiguration: 'Release'
182179
solution: 'nanoFirmwareFlasher.sln'
183180
run_update_dependents: $[dependencies.Check_Build_Options.outputs['BuildOptions.RUN_UPDATE_DEPENDENTS']]
184-
isTag: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/v')]
185181

186182
steps:
187183

@@ -200,7 +196,7 @@ jobs:
200196
displayName: Install .NET SDK
201197
condition: >-
202198
and(
203-
eq(variables['isTag'], 'false'),
199+
succeeded(),
204200
eq(variables['UPDATE_DEPENDENTS'], 'false')
205201
)
206202
inputs:
@@ -210,17 +206,14 @@ jobs:
210206
# only required when updating dependents
211207
- script: nbgv cloud -a -c
212208
condition: >-
213-
and(
214-
eq(variables['isTag'], 'false'),
215-
eq(variables['UPDATE_DEPENDENTS'], 'false')
216-
)
209+
eq(variables['UPDATE_DEPENDENTS'], 'true')
217210
displayName: Set Could Version
218211

219212
- task: DotNetCoreCLI@2
220213
displayName: Restore NuGet packages
221214
condition: >-
222215
and(
223-
eq(variables['isTag'], 'false'),
216+
succeeded(),
224217
eq(variables['UPDATE_DEPENDENTS'], 'false')
225218
)
226219
inputs:
@@ -234,15 +227,14 @@ jobs:
234227
displayName: Build NuGet package
235228
condition: >-
236229
and(
237-
eq(variables['isTag'], 'false'),
230+
succeeded(),
238231
eq(variables['UPDATE_DEPENDENTS'], 'false')
239232
)
240233
241234
- task: PowerShell@2
242235
condition: >-
243236
and(
244237
succeeded(),
245-
eq(variables['isTag'], 'false'),
246238
eq(variables['UPDATE_DEPENDENTS'], 'false')
247239
)
248240
displayName: Get NuGet build number
@@ -267,7 +259,6 @@ jobs:
267259
and(
268260
succeeded(),
269261
eq(variables['System.PullRequest.PullRequestId'], ''),
270-
eq(variables['isTag'], 'false'),
271262
eq(variables['UPDATE_DEPENDENTS'], 'false')
272263
)
273264
displayName: Update cloud build number
@@ -298,15 +289,14 @@ jobs:
298289
displayName: set release draft var
299290
condition: >-
300291
and(
301-
eq(variables['isTag'], 'false'),
292+
succeeded(),
302293
eq(variables['UPDATE_DEPENDENTS'], 'false')
303294
)
304295
305296
- task: CopyFiles@1
306297
condition: >-
307298
and(
308299
succeeded(),
309-
eq(variables['isTag'], 'false'),
310300
eq(variables['UPDATE_DEPENDENTS'], 'false')
311301
)
312302
displayName: Collecting deployable artifacts
@@ -323,7 +313,6 @@ jobs:
323313
and(
324314
succeeded(),
325315
eq(variables['System.PullRequest.PullRequestId'], ''),
326-
eq(variables['isTag'], 'false'),
327316
eq(variables['UPDATE_DEPENDENTS'], 'false')
328317
)
329318
inputs:
@@ -348,15 +337,13 @@ jobs:
348337
and(
349338
succeeded(),
350339
eq(variables['System.PullRequest.PullRequestId'], ''),
351-
eq(variables['isTag'], 'false'),
352340
eq(variables['UPDATE_DEPENDENTS'], 'false')
353341
)
354342
# publish artifacts
355343
- task: PublishBuildArtifacts@1
356344
condition: >-
357345
and(
358346
succeeded(),
359-
eq(variables['isTag'], 'false'),
360347
eq(variables['UPDATE_DEPENDENTS'], 'false')
361348
)
362349
displayName: Publish deployables artifacts
@@ -371,7 +358,6 @@ jobs:
371358
and(
372359
succeeded(),
373360
eq(variables['System.PullRequest.PullRequestId'], ''),
374-
eq(variables['isTag'], 'false'),
375361
eq(variables['UPDATE_DEPENDENTS'], 'false')
376362
)
377363
displayName: Push nanoff NuGet package to NuGet
@@ -390,7 +376,6 @@ jobs:
390376
and(
391377
succeeded(),
392378
eq(variables['System.PullRequest.PullRequestId'], ''),
393-
eq(variables['isTag'], 'false'),
394379
eq(variables['UPDATE_DEPENDENTS'], 'false')
395380
)
396381
displayName: Push library NuGet package to NuGet
@@ -408,7 +393,6 @@ jobs:
408393
condition: >-
409394
and(
410395
succeeded(),
411-
eq(variables['isTag'], 'false'),
412396
eq(variables['System.PullRequest.PullRequestId'], ''),
413397
eq(variables['UPDATE_DEPENDENTS'], 'false')
414398
)
@@ -437,8 +421,7 @@ jobs:
437421
condition: >-
438422
or(
439423
eq(variables['UPDATE_DEPENDENTS'], 'true'),
440-
eq(variables['run_update_dependents'], 'true'),
441-
eq(variables['isTag'], 'true')
424+
eq(variables['run_update_dependents'], 'true')
442425
)
443426
displayName: Update dependent tools
444427
inputs:
@@ -453,7 +436,11 @@ jobs:
453436
dependsOn:
454437
- Check_Build_Options
455438
- Build_tool
456-
condition: or( failed('Check_Build_Options'), failed('Build_tool') )
439+
condition: >-
440+
or(
441+
failed('Check_Build_Options'),
442+
failed('Build_tool')
443+
)
457444
458445
pool:
459446
vmImage: 'windows-latest'

0 commit comments

Comments
 (0)