From b87a8c07561b54a8f0e49787e141dc753194c3c6 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 8 Jan 2024 05:44:45 +0000 Subject: [PATCH] Build and publish ruby-wasm-wasi on CI The CI job was accidentally removed while I was working on the RubyGems support. --- Rakefile | 4 ++++ rakelib/packaging.rake | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index e7c2e76d32..d0e21809aa 100644 --- a/Rakefile +++ b/Rakefile @@ -41,6 +41,10 @@ NPM_PACKAGES = [ ruby_version: "3.2", gemfile: "packages/npm-packages/ruby-wasm-wasi/Gemfile", target: "wasm32-unknown-wasi" + }, + { + name: "ruby-wasm-wasi", + target: "wasm32-unknown-wasi" } ] diff --git a/rakelib/packaging.rake b/rakelib/packaging.rake index 2d3ca18762..ccaf2a1a25 100644 --- a/rakelib/packaging.rake +++ b/rakelib/packaging.rake @@ -6,6 +6,8 @@ tools = { } def npm_pkg_build_command(pkg) + # Skip if the package does not require building ruby + return nil unless pkg[:ruby_version] && pkg[:target] [ "bundle", "exec", @@ -22,6 +24,7 @@ end def npm_pkg_rubies_cache_key(pkg) build_command = npm_pkg_build_command(pkg) + return nil unless build_command require "open3" cmd = build_command + ["--print-ruby-cache-key"] stdout, status = Open3.capture2(*cmd) @@ -38,10 +41,13 @@ namespace :npm do pkg_dir = "#{Dir.pwd}/packages/npm-packages/#{pkg[:name]}" namespace pkg[:name] do - build_command = npm_pkg_build_command(pkg) desc "Build ruby for npm package #{pkg[:name]}" task "ruby" do + build_command = npm_pkg_build_command(pkg) + # Skip if the package does not require building ruby + next unless build_command + env = { # Share ./build and ./rubies in the same workspace "RUBY_WASM_ROOT" => base_dir