@@ -3,6 +3,13 @@ variables:
33- name : isMain
44 value : $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
55
6+ resources :
7+ repositories :
8+ - repository : wiki-scripts
9+ type : github
10+ name : analogdevicesinc/wiki-scripts
11+ endpoint : analogdevicesinc
12+
613trigger :
714- main
815- next_stable
@@ -141,6 +148,9 @@ stages:
141148 variables :
142149 SOURCE_DIRECTORY : $(Build.SourcesDirectory)/bin
143150 jobs :
151+ # Condition for publishing artifacts (same for Push_to_Artifactory and Publish_to_Cloudsmith):
152+ # - PRs (non-fork) targeting: main, next_stable, or 202* release branches
153+ # - Direct pushes to: main, next_stable, or 202* release branches
144154 - job : Push_to_Artifactory
145155 timeoutInMinutes : 90
146156 pool :
@@ -176,7 +186,43 @@ stages:
176186 ARTIFACTORY_TOKEN : $(ART_TOKEN)
177187 name : PushArtifacts
178188 displayName : " Push to Artifactory"
179-
189+ - job : Publish_to_Cloudsmith
190+ timeoutInMinutes : 120
191+ pool :
192+ name : Default
193+ demands :
194+ - agent.name -equals linux_default
195+ condition : or(
196+ and(
197+ startsWith(variables['Build.SourceBranch'], 'refs/pull/'),
198+ ne(variables['SYSTEM.PULLREQUEST.ISFORK'], 'true'),
199+ or(
200+ eq(variables['System.PullRequest.TargetBranch'], 'main'),
201+ eq(variables['System.PullRequest.TargetBranch'], 'next_stable'),
202+ startsWith(variables['System.PullRequest.TargetBranch'], '202')
203+ )
204+ ),
205+ or(
206+ eq(variables['Build.SourceBranch'], 'refs/heads/main'),
207+ eq(variables['Build.SourceBranch'], 'refs/heads/next_stable'),
208+ startsWith(variables['Build.SourceBranch'], 'refs/heads/202')
209+ )
210+ )
211+ steps :
212+ - checkout : self
213+ fetchDepth : 1
214+ clean : true
215+ - checkout : wiki-scripts
216+ fetchDepth : 1
217+ clean : true
218+ - task : DownloadPipelineArtifact@2
219+ inputs :
220+ path : $(Build.SourcesDirectory)/bin
221+ - bash : bash $(Build.SourcesDirectory)/linux/ci/travis/prepare_artifacts_for_cloudsmith.sh
222+ env :
223+ CLOUDSMITH_API_KEY : $(CLOUDSMITH_API_KEY)
224+ name : PushArtifacts
225+ displayName : " Push to Cloudsmith"
180226 - stage : TestHarness
181227 dependsOn : PushArtifacts
182228 condition : succeeded()
0 commit comments