Skip to content

Commit bfd927e

Browse files
committed
Work CI-CD
- Migrate to pattern to control update of dependents. - Add back tags as trigger. ***NO_CI***
1 parent a354bf3 commit bfd927e

File tree

1 file changed

+99
-42
lines changed

1 file changed

+99
-42
lines changed

azure-pipelines.yml

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

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

32-
pool:
33-
vmImage: 'windows-latest'
34-
3536
variables:
36-
- group: sign-client-credentials
3737
- name: DOTNET_NOLOGO
3838
value: true
39-
- name: buildPlatform
40-
value: 'Any CPU'
41-
- name: buildConfiguration
42-
value: 'Release'
43-
- name: solution
44-
value: 'nanoFramework.System.Collections.sln'
4539
- name: nugetPackageName
4640
value: 'nanoFramework.System.Collections'
4741

48-
steps:
49-
50-
# step from template @ nf-tools repo
51-
# all build, update and publish steps
52-
- template: azure-pipelines-templates/class-lib-build.yml@templates
53-
parameters:
54-
sonarCloudProject: 'nanoframework_lib-nanoFramework.System.Collections'
55-
runUnitTests: true
56-
unitTestRunsettings: '$(System.DefaultWorkingDirectory)\.runsettings'
57-
58-
# update dependencies
59-
# update dependents
60-
- template: azure-pipelines-templates/update-dependents.yml@templates
61-
parameters:
62-
${{ if eq(variables['UPDATE_DEPENDENTS'], 'true') }}:
63-
waitBeforeUpdate: false
64-
${{ else }}:
65-
waitBeforeUpdate: true
66-
repositoriesToUpdate: |
67-
System.Net.Http
68-
nanoFramework.Json
69-
nanoFramework.Graphics
70-
nanoFramework.m2mqtt
71-
amqpnetlite
72-
73-
# step from template @ nf-tools repo
74-
# report error
75-
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
76-
parameters:
77-
status: 'failure'
78-
webhookUrl: '$(DiscordWebhook)'
79-
message: ''
42+
jobs:
43+
44+
##############################
45+
- job: Build_Library
46+
condition: >-
47+
and(
48+
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')),
49+
or(
50+
eq(variables['UPDATE_DEPENDENTS'], 'false'),
51+
eq(variables['StartReleaseCandidate'], 'true')
52+
)
53+
)
54+
pool:
55+
vmImage: 'windows-latest'
56+
57+
variables:
58+
- group: sign-client-credentials
59+
- name: buildPlatform
60+
value: 'Any CPU'
61+
- name: buildConfiguration
62+
value: 'Release'
63+
- name: solution
64+
value: 'nanoFramework.DependencyInjection.sln'
65+
66+
steps:
67+
68+
# step from template @ nf-tools repo
69+
# all build, update and publish steps
70+
- template: azure-pipelines-templates/class-lib-build.yml@templates
71+
parameters:
72+
sonarCloudProject: 'nanoframework_lib-nanoFramework.System.Collections'
73+
runUnitTests: true
74+
unitTestRunsettings: '$(System.DefaultWorkingDirectory)\.runsettings'
75+
76+
##############################
77+
- job: Update_Dependents
78+
condition: >-
79+
or(
80+
and(
81+
startsWith(variables['Build.SourceBranch'], 'refs/tags/v'),
82+
eq(variables['StartReleaseCandidate'], 'false')
83+
),
84+
and(
85+
contains(variables['getCommitMessage.COMMIT_MESSAGE'], '***UPDATE_DEPENDENTS***'),
86+
eq(variables['StartReleaseCandidate'], 'false')
87+
),
88+
eq(variables['UPDATE_DEPENDENTS'], 'true')
89+
)
90+
91+
pool:
92+
vmImage: 'windows-latest'
93+
94+
steps:
95+
# need this here in order to persist GitHub credentials
96+
- checkout: self
97+
fetchDepth: 1
98+
99+
# update dependents
100+
- template: azure-pipelines-templates/update-dependents.yml@templates
101+
parameters:
102+
packageName: '$(nugetPackageName)'
103+
repositoriesToUpdate: |
104+
System.Net.Http
105+
nanoFramework.Json
106+
nanoFramework.Graphics
107+
nanoFramework.m2mqtt
108+
amqpnetlite
109+
110+
##################################
111+
# report build failure to Discord
112+
- job: Report_Build_Failure
113+
114+
dependsOn:
115+
- Build_Library
116+
- Update_Dependents
117+
condition: >-
118+
or(
119+
failed('Build_Library'),
120+
failed('Update_Dependents')
121+
)
122+
123+
pool:
124+
vmImage: 'windows-latest'
125+
126+
steps:
127+
128+
- checkout: self
129+
130+
# step from template @ nf-tools repo
131+
# report error
132+
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
133+
parameters:
134+
status: 'failure'
135+
webhookUrl: '$(DiscordWebhook)'
136+
message: ''

0 commit comments

Comments
 (0)