Skip to content

Commit

Permalink
compile assets manually
Browse files Browse the repository at this point in the history
  • Loading branch information
langalex committed Jan 22, 2025
1 parent 3795b2b commit f9a1e2a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- name: Update surfer gem
run: bundle update comfortable_media_surfer

- name: Compile assets
run: bin/bundle exec rails comfy:compile_assets

- name: Run tests, report coverage
run: |
bin/bundle exec rails db:drop
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
- name: Update surfer gem
run: bundle update comfortable_media_surfer

- name: Compile assets
run: bin/bundle exec rails comfy:compile_assets

- name: Run tests
run: |
bin/bundle exec rails db:drop
Expand Down
4 changes: 4 additions & 0 deletions comfortable_media_surfer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Gem::Specification.new do |spec|
spec.description = 'ComfortableMediaSurfer is a powerful Rails 7.0+ CMS Engine'
spec.license = 'MIT'

spec.post_install_message = <<~MSG
Please run rake comfy:compile_assets to compile assets.
MSG

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|doc)/})
end
Expand Down
14 changes: 0 additions & 14 deletions lib/rubygems_plugin.rb

This file was deleted.

19 changes: 19 additions & 0 deletions lib/tasks/cms_assets.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

namespace :comfy do
desc 'Compile SCSS and JS assets for propshaft.'
task :compile_assets do
puts 'Compiling assets...'
dir = File.expand_path("#{__dir__}/..")
Dir.chdir(dir) do
unless system("npm install")
puts 'Error: Failed to install npm packages.'
exit(-1)
end
unless system("npm run build && npm run build:css")
puts 'Error: Failed to compile assets'
exit(-1)
end
end
end
end

0 comments on commit f9a1e2a

Please sign in to comment.