diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d52687b..f9a75713 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' diff --git a/ruby/private/gem_push.bzl b/ruby/private/gem_push.bzl index b174e55a..d376a819 100644 --- a/ruby/private/gem_push.bzl +++ b/ruby/private/gem_push.bzl @@ -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(