Skip to content

Commit

Permalink
Fix ruby gem build
Browse files Browse the repository at this point in the history
  • Loading branch information
thestephenmarshall committed Jul 15, 2024
1 parent 5bc80ff commit 7b23689
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-alpha-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
npm publish --registry https://registry.npmjs.org playbook-ui-${{ env.new_npm_alpha_version }}.tgz --tag alpha
- name: Version Up, Distribute and Publish (RubyGems)
run: |
gem build playbook_ui.gemspec
bin/build_gem
gem build lib/playbook_ui_docs.gemspec
rm -rf dist/playbook-doc.js dist/playbook-rails.js dist/app dist/pb_doc_helper.rb dist/menu.yml
echo "${{ env.new_ruby_alpha_version }}"
Expand Down
7 changes: 7 additions & 0 deletions playbook/bin/build_gem
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

cp ../playbook-website/config/menu.yml dist/menu.yml

time $(gem build playbook_ui.gemspec)

rm dist/menu.yml
2 changes: 2 additions & 0 deletions playbook/lib/playbook/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ class Engine < ::Rails::Engine
if config.respond_to?(:assets)
config.assets.paths ||= []
config.assets.paths << Playbook::Engine.root.join("fonts")
config.assets.paths << Playbook::Engine.root.join("dist")
config.assets.paths << Playbook::Engine.root.join("app/pb_kits/playbook/pb_*")
end

if config.respond_to?(:sass)
config.sass.load_paths ||= []
config.sass.load_paths << Playbook::Engine.root.join("dist")
config.sass.load_paths << Playbook::Engine.root.join("app/pb_kits/playbook")
end
end
Expand Down
9 changes: 5 additions & 4 deletions playbook/playbook_ui.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ Gem::Specification.new do |s|
s.files = Dir[
"app/pb_kits/playbook/pb_*/**/*",
"app/pb_kits/playbook/{plugins,tokens,utilities}/**/*",
"app/pb_kits/playbook/*.{scss,js,rb}",
"app/assets/images/*",
"fonts/**/*",
"lib/*.rb",
"lib/playbook/**/*",
"dist/chunks/*",
"dist/playbook.css",
"dist/reset.css",
"dist/playbook-doc.js",
"dist/playbook-rails.js",
"dist/playbook-rails-react-bindings.js",
"dist/menu.yml",
] + ["Rakefile"]

# s.files += Dir.glob("app/pb_kits/playbook/pb_*/**/*").reject do |file|
# (file == "docs") || (file.include? "docs")
# end
s.files.reject! { |file| file == "dist/chunks/lib.js" }

s.add_dependency "actionpack", ">= 5.2.4.5"
s.add_dependency "actionview", ">= 5.2.4.5"
Expand Down
2 changes: 1 addition & 1 deletion playbook/private/tasks/pb_release.rake
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace :pb_release do

# RubyGems
puts "\nCreating Gem..."
`gem build playbook_ui.gemspec`
`bin/build_gem`
puts "\nCreating Docs Gem..."
`gem build lib/playbook_ui_docs.gemspec`
# Publish to RubyGems
Expand Down

0 comments on commit 7b23689

Please sign in to comment.