Skip to content

Commit 8cf73f0

Browse files
committed
fix: Run yarn install --prod in ./release.sh
semantic-release runs 'gem build appmap.gemspec', not 'rake gem:build', so the customization that was running yarn install --prod during the rake task wasn't actually getting called when releases were made. The result was missing node_modules, and the rake tasks that depend on the NodeJS code were broken.
1 parent 19c3833 commit 8cf73f0

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Rakefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,11 @@ namespace 'gem' do
1818

1919
module Bundler
2020
class GemHelper
21-
alias default_build_gem build_gem
22-
2321
# A handy tip - find the location of any Rake task using `rake -W`.
2422
# rake -W build
2523
# ~/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/gem_helper.rb:39:in `install'
2624
def build_gem
27-
# Ensure that NPM packages are installed before building.
28-
sh('yarn install --prod')
29-
30-
default_build_gem
25+
raise "Don't use 'rake gem:build' - use 'yarn install --prod && gem build <gemspec>', because that's what ./release.sh does"
3126
end
3227
end
3328
end
@@ -81,7 +76,12 @@ namespace :build do
8176
namespace :base do
8277
RUBY_VERSIONS.each do |ruby_version|
8378
desc ruby_version
84-
task ruby_version => ["gem:build"] do
79+
task ruby_version do
80+
run_system = ->(cmd) { system(cmd) or raise "Command failed: #{cmd}" }
81+
82+
run_system.call 'mkdir -p pkg'
83+
run_system.call 'yarn install --prod'
84+
run_system.call "gem build appmap.gemspec --output pkg/appmap-#{GEM_VERSION}.gem"
8585
build_base_image(ruby_version)
8686
end.tap do |t|
8787
desc "Build all images"

release.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ else
1212
echo "No GEM_ALTERNATIVE_NAME is provided, releasing gem with default name ('appmap')"
1313
fi
1414

15-
set -x
15+
set -ex
16+
yarn install --prod
1617
exec semantic-release $RELEASE_FLAGS

0 commit comments

Comments
 (0)