diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f95b54d1..2e03084a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,18 +19,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [2.7, "3.0", 3.1] - + ruby: ["2.7", "3.0", "3.1"] steps: - uses: actions/checkout@v2 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 + - run: rm Gemfile.lock + - uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} + ruby-version: ${{matrix.ruby}} bundler: latest bundler-cache: true - - name: Run tests run: bin/test @@ -42,6 +39,7 @@ jobs: runs-on: ${{matrix.plat}}-latest steps: - uses: actions/checkout@v2 + - run: rm Gemfile.lock - uses: ruby/setup-ruby@v1 with: ruby-version: "3.1" diff --git a/.github/workflows/gem-install.yml b/.github/workflows/gem-install.yml index 2cca1a7b..c15431bb 100644 --- a/.github/workflows/gem-install.yml +++ b/.github/workflows/gem-install.yml @@ -23,9 +23,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - run: rm Gemfile.lock - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.0" + ruby-version: "3.1" bundler: latest bundler-cache: true - run: "bundle exec rake gem:${{matrix.platform}}" @@ -41,7 +42,7 @@ jobs: steps: - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.0" + ruby-version: "3.1" - uses: actions/download-artifact@v2 with: name: gem-ruby @@ -55,11 +56,26 @@ jobs: steps: - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.0" + ruby-version: "3.1" + - uses: actions/download-artifact@v2 + with: + name: gem-x86_64-linux + path: pkg + - run: "gem install pkg/tailwindcss-rails-*.gem" + - run: "tailwindcss --help" + + linux-musl-install: + needs: ["package"] + runs-on: ubuntu-latest + container: + image: ruby:3.1-alpine + steps: - uses: actions/download-artifact@v2 with: name: gem-x86_64-linux path: pkg + - run: "gem update --system" + - run: "apk add build-base" # TODO: remove after https://github.com/rubygems/rubygems/issues/5914 is in a rubygems release - run: "gem install pkg/tailwindcss-rails-*.gem" - run: "tailwindcss --help" @@ -69,7 +85,7 @@ jobs: steps: - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.0" + ruby-version: "3.1" - uses: actions/download-artifact@v2 with: name: gem-x86_64-darwin diff --git a/lib/tailwindcss/commands.rb b/lib/tailwindcss/commands.rb index 136b5eee..e7f34cb5 100644 --- a/lib/tailwindcss/commands.rb +++ b/lib/tailwindcss/commands.rb @@ -18,7 +18,7 @@ def platform def executable( exe_path: File.expand_path(File.join(__dir__, "..", "..", "exe")) ) - if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match(p) } + if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match(Gem::Platform.new(p)) } raise UnsupportedPlatformException, <<~MESSAGE tailwindcss-rails does not support the #{platform} platform Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation @@ -26,7 +26,7 @@ def executable( end exe_path = Dir.glob(File.expand_path(File.join(exe_path, "*", "tailwindcss"))).find do |f| - Gem::Platform.match(File.basename(File.dirname(f))) + Gem::Platform.match(Gem::Platform.new(File.basename(File.dirname(f)))) end if exe_path.nil?