Skip to content

Commit

Permalink
[build] create publish-pypi task
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 7, 2023
1 parent 1506256 commit 6620bce
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ def dotnet_version
end
end

def python_version
File.foreach('py/BUILD.bazel') do |line|
return line.split('=').last.strip.tr('"', '') if line.include?('SE_VERSION')
end
end

# The build system used by webdriver is layered on top of rake, and we call it
# "crazy fun" for no readily apparent reason.

Expand Down Expand Up @@ -423,6 +429,17 @@ task :prepare_release do
Bazel::execute('build', ['--stamp'], '//rb:selenium-webdriver')
end

PYPI_ASSETS = [
"bazel-bin/py/selenium-#{python_version}-py3-none-any.whl",
"bazel-bin/py/selenium-#{python_version}.tar.gz"
]

task 'publish-pypi' do
PYPI_ASSETS.each do |asset|
sh "python3 -m twine upload #{asset}"
end
end

task 'publish-maven': JAVA_RELEASE_TARGETS do
creds = read_m2_user_pass
JAVA_RELEASE_TARGETS.each do |p|
Expand Down

0 comments on commit 6620bce

Please sign in to comment.