@@ -17,6 +17,10 @@ trigger:
1717 - assets/*
1818 - .github/*
1919
20+ tags :
21+ include :
22+ - v*
23+
2024# PR always trigger build
2125pr :
2226 autoCancel : true
@@ -29,36 +33,101 @@ 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.DependencyInjection.sln'
45- - name : nugetPackageName
46- value : ' nanoFramework.DependencyInjection'
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_nanoFramework.DependencyInjection'
55- runUnitTests : true
56- unitTestRunsettings : ' $(System.DefaultWorkingDirectory)\.runsettings'
57-
58- # step from template @ nf-tools repo
59- # report error
60- - template : azure-pipelines-templates/discord-webhook-task.yml@templates
61- parameters :
62- status : ' failure'
63- webhookUrl : ' $(DiscordWebhook)'
64- 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.DependencyInjection.sln'
61+ - name : nugetPackageName
62+ value : ' nanoFramework.DependencyInjection'
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_nanoFramework.DependencyInjection'
71+ runUnitTests : true
72+ unitTestRunsettings : ' $(System.DefaultWorkingDirectory)\.runsettings'
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+ variables :
93+ DOTNET_NOLOGO : true
94+
95+ steps :
96+ # need this here in order to persist GitHub credentials
97+ - checkout : self
98+ fetchDepth : 1
99+
100+ # update dependents
101+ - template : azure-pipelines-templates/update-dependents.yml@templates
102+ parameters :
103+ waitBeforeUpdate : ${{ not(eq(variables['UPDATE_DEPENDENTS'], 'true')) }}
104+ repositoriesToUpdate : |
105+ nanoFramework.Hosting
106+
107+ # #################################
108+ # report build failure to Discord
109+ - job : Report_Build_Failure
110+
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 :
124+
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