Skip to content

Commit 706dcfc

Browse files
committed
Work CI-CD
- Move common variables to top. - Migrate parameters to update dependents template. - Fix yaml indentation. ***NO_CI***
1 parent 810e994 commit 706dcfc

File tree

1 file changed

+92
-93
lines changed

1 file changed

+92
-93
lines changed

azure-pipelines.yml

Lines changed: 92 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -33,102 +33,101 @@ resources:
3333
name: nanoframework/nf-tools
3434
endpoint: nanoframework
3535

36+
variables:
37+
- name: DOTNET_NOLOGO
38+
value: true
39+
- name: nugetPackageName
40+
value: 'nanoFramework.System.IO.Streams'
41+
3642
jobs:
3743

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.Streams.sln'
61-
- name: nugetPackageName
62-
value: 'nanoFramework.System.IO.Streams'
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.Streams'
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: false
102-
repositoriesToUpdate: |
103-
System.Net
104-
System.IO.Ports
105-
nanoFramework.Logging
106-
nanoFramework.Json
107-
108-
##################################
109-
# report build failure to Discord
110-
- job: Report_Build_Failure
111-
112-
dependsOn:
113-
- Build_Library
114-
- Update_Dependents
115-
condition: >-
44+
##############################
45+
- job: Build_Library
46+
condition: >-
47+
and(
48+
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')),
11649
or(
117-
failed('Build_Library'),
118-
failed('Update_Dependents')
50+
eq(variables['UPDATE_DEPENDENTS'], 'false'),
51+
eq(variables['StartReleaseCandidate'], 'true')
11952
)
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.System.IO.Streams.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_System.IO.Streams'
73+
74+
##############################
75+
- job: Update_Dependents
76+
condition: >-
77+
or(
78+
and(
79+
startsWith(variables['Build.SourceBranch'], 'refs/tags/v'),
80+
eq(variables['StartReleaseCandidate'], 'false')
81+
),
82+
and(
83+
contains(variables['getCommitMessage.COMMIT_MESSAGE'], '***UPDATE_DEPENDENTS***'),
84+
eq(variables['StartReleaseCandidate'], 'false')
85+
),
86+
eq(variables['UPDATE_DEPENDENTS'], 'true')
87+
)
88+
89+
pool:
90+
vmImage: 'windows-latest'
91+
92+
steps:
93+
# need this here in order to persist GitHub credentials
94+
- checkout: self
95+
fetchDepth: 1
96+
97+
# update dependents
98+
- template: azure-pipelines-templates/update-dependents.yml@templates
99+
parameters:
100+
packageName: '$(nugetPackageName)'
101+
repositoriesToUpdate: |
102+
System.Net
103+
System.IO.Ports
104+
nanoFramework.Logging
105+
nanoFramework.Json
106+
107+
##################################
108+
# report build failure to Discord
109+
- job: Report_Build_Failure
120110

121-
pool:
122-
vmImage: 'windows-latest'
123-
124-
steps:
125-
126-
- checkout: self
111+
dependsOn:
112+
- Build_Library
113+
- Update_Dependents
114+
condition: >-
115+
or(
116+
failed('Build_Library'),
117+
failed('Update_Dependents')
118+
)
119+
120+
pool:
121+
vmImage: 'windows-latest'
122+
123+
steps:
127124

128-
# step from template @ nf-tools repo
129-
# report error
130-
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
131-
parameters:
132-
status: 'failure'
133-
webhookUrl: '$(DiscordWebhook)'
134-
message: ''
125+
- checkout: self
126+
127+
# step from template @ nf-tools repo
128+
# report error
129+
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
130+
parameters:
131+
status: 'failure'
132+
webhookUrl: '$(DiscordWebhook)'
133+
message: ''

0 commit comments

Comments
 (0)