Skip to content

Commit 6620bce

Browse files
committed
[build] create publish-pypi task
1 parent 1506256 commit 6620bce

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Rakefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ def dotnet_version
6262
end
6363
end
6464

65+
def python_version
66+
File.foreach('py/BUILD.bazel') do |line|
67+
return line.split('=').last.strip.tr('"', '') if line.include?('SE_VERSION')
68+
end
69+
end
70+
6571
# The build system used by webdriver is layered on top of rake, and we call it
6672
# "crazy fun" for no readily apparent reason.
6773

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

432+
PYPI_ASSETS = [
433+
"bazel-bin/py/selenium-#{python_version}-py3-none-any.whl",
434+
"bazel-bin/py/selenium-#{python_version}.tar.gz"
435+
]
436+
437+
task 'publish-pypi' do
438+
PYPI_ASSETS.each do |asset|
439+
sh "python3 -m twine upload #{asset}"
440+
end
441+
end
442+
426443
task 'publish-maven': JAVA_RELEASE_TARGETS do
427444
creds = read_m2_user_pass
428445
JAVA_RELEASE_TARGETS.each do |p|

0 commit comments

Comments
 (0)