Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
- run: bazel run "@ruby//:gem" "--" info
- run: bazel run "@bundle//bin:rake" "--" --version
- run: bazel run "@bundle//bin:rspec" "--" --help
- run: bazel run :gem-release "--" --help
- run: bazel test ...
- name: Run coverage
if: matrix.os != 'windows-latest'
Expand Down
11 changes: 8 additions & 3 deletions ruby/private/gem_push.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ def _rb_gem_push_impl(ctx):
if ctx.attr.ruby != None:
ruby_toolchain = ctx.attr.ruby[platform_common.ToolchainInfo]
srcs = [ctx.file.gem]
tools = [ruby_toolchain.gem]
tools = list(ruby_toolchain.files)
java_bin = ""

if ruby_toolchain.version.startswith("jruby"):
env["JAVA_HOME"] = java_toolchain.java_runtime.java_home
tools.extend(java_toolchain.java_runtime.files.to_list())
java_bin = java_toolchain.java_runtime.java_executable_runfiles_path[3:]

env.update(ruby_toolchain.env)
env.update(ctx.attr.env)

script = generate_rb_binary_script(
ctx,
binary = ruby_toolchain.gem,
bundler = False,
args = ["push", ctx.file.gem.short_path],
env = env,
java_bin = java_bin,
)

runfiles = ctx.runfiles(srcs + tools)
runfiles = runfiles.merge(ctx.attr._runfiles_library[DefaultInfo].default_runfiles)
env.update(ctx.attr.env)

return [
DefaultInfo(
Expand Down
Loading