@@ -16,7 +16,11 @@ trigger:
1616 - NuGet.Config
1717 - assets/*
1818 - .github/*
19-
19+
20+ tags :
21+ include :
22+ - v*
23+
2024# PR always trigger build
2125pr :
2226 autoCancel : true
@@ -29,39 +33,106 @@ resources:
2933 name : nanoframework/nf-tools
3034 endpoint : nanoframework
3135
32- pool :
33- vmImage : ' windows-latest'
34-
3536variables :
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.Math.sln'
4537 - name : nugetPackageName
46- value : ' nanoFramework.System.Math'
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_lib-nanoFramework.System.Math'
55- runUnitTests : true
56- unitTestRunsettings : ' $(System.DefaultWorkingDirectory)\.runsettings'
57-
58- # update UnitsNet
59- - template : azure-pipelines-templates/update-units-net.yml@templates
60-
61- # step from template @ nf-tools repo
62- # report error
63- - template : azure-pipelines-templates/discord-webhook-task.yml@templates
64- parameters :
65- status : ' failure'
66- webhookUrl : ' $(DiscordWebhook)'
67- message : ' '
38+ value : ' nanoFramework.DependencyInjection'
39+ - name : DOTNET_NOLOGO
40+ value : true
41+
42+
43+ jobs :
44+
45+ # #############################
46+ - job : Build_Library
47+ condition : >-
48+ and(
49+ not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')),
50+ or(
51+ eq(variables['UPDATE_DEPENDENTS'], 'false'),
52+ eq(variables['StartReleaseCandidate'], 'true')
53+ )
54+ )
55+
56+ pool :
57+ vmImage : ' windows-latest'
58+
59+ variables :
60+ - group : sign-client-credentials
61+ - name : DOTNET_NOLOGO
62+ value : true
63+ - name : buildPlatform
64+ value : ' Any CPU'
65+ - name : buildConfiguration
66+ value : ' Release'
67+ - name : solution
68+ value : ' nanoFramework.System.Math.sln'
69+
70+ steps :
71+
72+ # step from template @ nf-tools repo
73+ # all build, update and publish steps
74+ - template : azure-pipelines-templates/class-lib-build.yml@templates
75+ parameters :
76+ sonarCloudProject : ' nanoframework_lib-nanoFramework.System.Math'
77+ runUnitTests : true
78+ unitTestRunsettings : ' $(System.DefaultWorkingDirectory)\.runsettings'
79+
80+ # #############################
81+ - job : Update_Dependents
82+ condition : >-
83+ or(
84+ and(
85+ startsWith(variables['Build.SourceBranch'], 'refs/tags/v'),
86+ eq(variables['StartReleaseCandidate'], 'false')
87+ ),
88+ and(
89+ contains(variables['getCommitMessage.COMMIT_MESSAGE'], '***UPDATE_DEPENDENTS***'),
90+ eq(variables['StartReleaseCandidate'], 'false')
91+ ),
92+ eq(variables['UPDATE_DEPENDENTS'], 'true')
93+ )
94+
95+ pool :
96+ vmImage : ' windows-latest'
97+
98+ steps :
99+ # need this here in order to persist GitHub credentials
100+ - checkout : self
101+ fetchDepth : 1
102+
103+ # update dependents
104+ # use this to make sure nuget package is published
105+ - template : azure-pipelines-templates/update-dependents.yml@templates
106+ parameters :
107+ packageName : ' $(nugetPackageName)'
108+ repositoriesToUpdate :
109+
110+ - template : azure-pipelines-templates/update-units-net.yml@templates
111+
112+ # #################################
113+ # report build failure to Discord
114+ - job : Report_Build_Failure
115+
116+ dependsOn :
117+ - Build_Library
118+ - Update_Dependents
119+ condition : >-
120+ or(
121+ failed('Build_Library'),
122+ failed('Update_Dependents')
123+ )
124+
125+ pool :
126+ vmImage : ' windows-latest'
127+
128+ steps :
129+
130+ - checkout : self
131+
132+ # step from template @ nf-tools repo
133+ # report error
134+ - template : azure-pipelines-templates/discord-webhook-task.yml@templates
135+ parameters :
136+ status : ' failure'
137+ webhookUrl : ' $(DiscordWebhook)'
138+ message : ' '
0 commit comments