Skip to content

Commit e1c8ff2

Browse files
committed
[build] fix release mirror push target and poll Maven Central when verifying Java
1 parent 7f32b68 commit e1c8ff2

2 files changed

Lines changed: 15 additions & 18 deletions

File tree

.github/workflows/mirror-selenium-releases.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v6
1616
with:
17+
ref: trunk
1718
persist-credentials: false
1819
- name: Read api.github.com and filter response
1920
run: |
@@ -54,4 +55,4 @@ jobs:
5455
uses: ad-m/github-push-action@master
5556
with:
5657
github_token: ${{ secrets.SELENIUM_CI_TOKEN }}
57-
branch: ${{ github.ref }}
58+
branch: trunk

rake_tasks/java.rake

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -279,22 +279,6 @@ task :release do |_task, arguments|
279279
args = arguments.to_a
280280
nightly = args.delete('nightly')
281281

282-
unless nightly
283-
already_published = begin
284-
Rake::Task['java:verify'].invoke
285-
true
286-
rescue StandardError
287-
false
288-
ensure
289-
Rake::Task['java:verify'].reenable
290-
end
291-
292-
if already_published
293-
puts 'Java packages already published — skipping release.'
294-
next
295-
end
296-
end
297-
298282
Rake::Task['java:check_credentials'].invoke(*(nightly ? ['nightly'] : []))
299283

300284
ENV['MAVEN_USER'] ||= ENV.fetch('SEL_M2_USER', nil)
@@ -330,7 +314,19 @@ end
330314
desc 'Verify Java packages are published on Maven Central'
331315
task :verify do
332316
base = 'https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-java'
333-
SeleniumRake.verify_package_published("#{base}/#{java_version}/selenium-java-#{java_version}.pom")
317+
deadline = Process.clock_gettime(Process::CLOCK_MONOTONIC) + 600
318+
319+
begin
320+
SeleniumRake.verify_package_published("#{base}/#{java_version}/selenium-java-#{java_version}.pom")
321+
rescue StandardError => e
322+
if Process.clock_gettime(Process::CLOCK_MONOTONIC) > deadline
323+
raise "#{e.message}; check https://central.sonatype.com/publishing/deployments"
324+
end
325+
326+
puts " #{e.message}; Maven Central may still be indexing, retrying in 15s"
327+
sleep 15
328+
retry
329+
end
334330
end
335331

336332
desc 'Install jars to local m2 directory'

0 commit comments

Comments
 (0)