Skip to content

Commit 4df130a

Browse files
committed
Work CI-CD
- Migrate to jobs pattern to use update dependents. - Add back tags trigger. ***NO_CI***
1 parent 940df9c commit 4df130a

File tree

1 file changed

+100
-41
lines changed

1 file changed

+100
-41
lines changed

azure-pipelines.yml

Lines changed: 100 additions & 41 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,44 +33,99 @@ resources:
2933
name: nanoframework/nf-tools
3034
endpoint: nanoframework
3135

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

0 commit comments

Comments
 (0)