Skip to content

Commit f15fdba

Browse files
committed
Work CI-CD
- Add back tags as trigger. - Migrate yaml pattern to job update.
1 parent 3124763 commit f15fdba

File tree

1 file changed

+24
-28
lines changed

1 file changed

+24
-28
lines changed

azure-pipelines.yml

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ trigger:
1717
- config/*
1818
- .github/*
1919

20+
tags:
21+
include:
22+
- v*
23+
2024
# PR always trigger build
2125
pr:
2226
autoCancel: true
@@ -29,6 +33,12 @@ resources:
2933
name: nanoframework/nf-tools
3034
endpoint: nanoframework
3135

36+
variables:
37+
- name: DOTNET_NOLOGO
38+
value: true
39+
- name: nugetPackageName
40+
value: 'nanoFramework.Tools.MetadataProcessor.MsBuildTask'
41+
3242
jobs:
3343

3444
##############################
@@ -94,7 +104,11 @@ jobs:
94104
##############################
95105
# build MDP
96106
- job: Build_MDP
97-
condition: eq(variables['UPDATE_DEPENDENTS'], 'false')
107+
condition:
108+
and(
109+
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')),
110+
eq(variables['UPDATE_DEPENDENTS'], 'false')
111+
)
98112

99113
dependsOn:
100114
- Get_Build_Flags
@@ -104,8 +118,6 @@ jobs:
104118

105119
variables:
106120
- group: sign-client-credentials
107-
- name: DOTNET_NOLOGO
108-
value: true
109121
- name: buildPlatform
110122
value: 'Any CPU'
111123
- name: buildConfiguration
@@ -249,7 +261,6 @@ jobs:
249261
.\sign code azure-key-vault `
250262
"**/*.nupkg" `
251263
--base-directory "$(Build.ArtifactStagingDirectory)" `
252-
--file-list "$(Build.Repository.LocalPath)\config\filelist.txt" `
253264
--description ".NET nanoFramework MDP" `
254265
--description-url "https://github.com/$env:Build_Repository_Name" `
255266
--azure-key-vault-tenant-id "$(SignTenantId)" `
@@ -322,16 +333,9 @@ jobs:
322333
##############################
323334
- job: Update_Dependents
324335
condition: >-
325-
and(
326-
or(
327-
succeeded('Build_MDP'),
328-
not(in(dependencies.PreviousJob.result, 'Succeeded', 'Failed', 'Canceled'))
329-
),
330-
or(
331-
eq(dependencies.Get_Build_Flags.outputs['GetPRLabels.RUN_UPDATE_DEPENDENTS'], 'true'),
332-
eq(variables['UPDATE_DEPENDENTS'], 'true')
333-
),
334-
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
336+
or(
337+
startsWith(variables['Build.SourceBranch'], 'refs/tags/v'),
338+
eq(variables['UPDATE_DEPENDENTS'], 'true')
335339
)
336340
337341
dependsOn:
@@ -341,25 +345,17 @@ jobs:
341345
pool:
342346
vmImage: 'windows-latest'
343347

344-
variables:
345-
DOTNET_NOLOGO: true
346-
347348
steps:
348349
# need this here in order to persist GitHub credentials
349350
- checkout: self
350351
fetchDepth: 1
351-
352-
# Conditional delay step
353-
- powershell: |
354-
if ($env:BUILD_MDP_RESULT -eq 'Succeeded') {
355-
Write-Host "Build_MDP succeeded, waiting for 10 minutes for the NuGet package to be processed before starting the job..."
356-
Start-Sleep -Seconds 600
357-
}
358-
displayName: 'Waiting for NuGet being published'
359-
env:
360-
BUILD_MDP_RESULT: $(Build.MDP.result)
361352

362-
- template: azure-pipelines-templates/install-nuget.yml@templates
353+
# update dependents
354+
# use this to make sure nuget package is published
355+
- template: azure-pipelines-templates/update-dependents.yml@templates
356+
parameters:
357+
packageName: '$(nugetPackageName)'
358+
repositoriesToUpdate:
363359

364360
# update dependencies
365361
- task: PowerShell@2

0 commit comments

Comments
 (0)