Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/update-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ jobs:
with:
name: Generate Docs
ref: ${{ inputs.tag }}
run: ./go ${{ needs.parse.outputs.language }}:docs skip_update
run: ./go ${{ needs.parse.outputs.language }}:docs
artifact-name: documentation
artifact-path: docs/api/**/*
artifact-path: build/docs/api/**/*

commit-docs:
name: Commit Documentation
Expand Down
56 changes: 7 additions & 49 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,6 @@ namespace :node do
puts 'Generating Node documentation'
FileUtils.rm_rf('build/docs/api/javascript/')
Bazel.execute('run', [], '//javascript/selenium-webdriver:docs')

update_gh_pages unless arguments.to_a.include?('skip_update')
end

desc 'Update JavaScript changelog'
Expand Down Expand Up @@ -766,8 +764,6 @@ namespace :py do

FileUtils.mkdir_p('build/docs/api')
FileUtils.cp_r('bazel-bin/py/docs/_build/html/.', 'build/docs/api/py')

update_gh_pages unless arguments.to_a.include?('skip_update')
end

desc 'Install Python wheel locally'
Expand Down Expand Up @@ -938,8 +934,6 @@ namespace :rb do
Bazel.execute('run', [], '//rb:docs')
FileUtils.mkdir_p('build/docs/api')
FileUtils.cp_r('bazel-bin/rb/docs.sh.runfiles/_main/docs/api/rb/.', 'build/docs/api/rb')

update_gh_pages unless arguments.to_a.include?('skip_update')
end

desc 'Update Ruby changelog'
Expand Down Expand Up @@ -1099,8 +1093,6 @@ namespace :dotnet do
puts 'Generating .NET documentation'
FileUtils.rm_rf('build/docs/api/dotnet/')
Bazel.execute('run', [], '//dotnet:docs')

update_gh_pages unless arguments.to_a.include?('skip_update')
end

desc 'Update .NET changelog'
Expand Down Expand Up @@ -1289,8 +1281,6 @@ namespace :java do

puts 'Generating Java documentation'
Rake::Task['javadocs'].invoke

update_gh_pages unless arguments.to_a.include?('skip_update')
end

desc 'Update Maven dependencies'
Expand Down Expand Up @@ -1435,16 +1425,14 @@ namespace :all do
'Rakefile'].each { |file| @git.add(file) }
end

desc 'Update all API Documentation'
desc 'Build all API Documentation'
task :docs do |_task, arguments|
args = arguments.to_a
Rake::Task['java:docs'].invoke(*(args + ['skip_update']))
Rake::Task['py:docs'].invoke(*(args + ['skip_update']))
Rake::Task['rb:docs'].invoke(*(args + ['skip_update']))
Rake::Task['dotnet:docs'].invoke(*(args + ['skip_update']))
Rake::Task['node:docs'].invoke(*(args + ['skip_update']))

update_gh_pages
args = arguments.to_a.compact
Rake::Task['java:docs'].invoke(*args)
Rake::Task['py:docs'].invoke(*args)
Rake::Task['rb:docs'].invoke(*args)
Rake::Task['dotnet:docs'].invoke(*args)
Rake::Task['node:docs'].invoke(*args)
end

desc 'Build all artifacts for all language bindings'
Expand Down Expand Up @@ -1590,36 +1578,6 @@ def updated_version(current, desired = nil, nightly = nil)
end
end

def update_gh_pages(force: true)
puts 'Switching to gh-pages branch...'
@git.fetch('https://github.com/seleniumhq/selenium.git', {ref: 'gh-pages'})

unless force
puts 'Stash changes that are not docs...'
@git.lib.send(:command, 'stash', ['push', '-m', 'stash wip', '--', ':(exclude)build/docs/api/'])
end

@git.checkout('gh-pages', force: force)

updated = false

%w[java rb py dotnet javascript].each do |language|
source = "build/docs/api/#{language}"
destination = "docs/api/#{language}"

next unless Dir.exist?(source) && !Dir.empty?(source)

puts "Updating documentation for #{language}..."
FileUtils.rm_rf(destination)
FileUtils.mv(source, destination)

@git.add(destination)
updated = true
end

puts(updated ? 'Documentation staged. Ready for commit.' : 'No documentation changes found.')
end

def previous_tag(current_version, language = nil)
version = current_version.split(/\.|-/)
if version.size > 3
Expand Down