From b8d2e62ac3a1b42091d38d562e4031cffe5f5fe6 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 19 Sep 2022 13:49:34 -0400 Subject: [PATCH 1/4] ci: update pipelines to use ruby 3.1 --- .github/workflows/ci.yml | 10 +++------- .github/workflows/gem-install.yml | 8 ++++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f95b54d1..61c8bbea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,18 +19,14 @@ 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 + - 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 diff --git a/.github/workflows/gem-install.yml b/.github/workflows/gem-install.yml index 2cca1a7b..cb2086de 100644 --- a/.github/workflows/gem-install.yml +++ b/.github/workflows/gem-install.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v2 - 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 +41,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,7 +55,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-linux @@ -69,7 +69,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 From 8dc39c5cfd19b980497a5cdbb6ecf4e02fd9cf98 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 19 Sep 2022 13:50:28 -0400 Subject: [PATCH 2/4] ci: delete Gemfile.lock https://bundler.io/blog/2018/01/17/making-gem-development-a-little-better.html --- .github/workflows/ci.yml | 2 ++ .github/workflows/gem-install.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61c8bbea..2e03084a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: ruby: ["2.7", "3.0", "3.1"] steps: - uses: actions/checkout@v2 + - run: rm Gemfile.lock - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}} @@ -38,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 cb2086de..fd64c0dd 100644 --- a/.github/workflows/gem-install.yml +++ b/.github/workflows/gem-install.yml @@ -23,6 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - run: rm Gemfile.lock - uses: ruby/setup-ruby@v1 with: ruby-version: "3.1" From 15dbf2ae5694997dee9d1d3ea965f0da7eda13f5 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 19 Sep 2022 12:34:59 -0400 Subject: [PATCH 3/4] ci: try to reproduce the musl issue from #200 --- .github/workflows/gem-install.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/gem-install.yml b/.github/workflows/gem-install.yml index fd64c0dd..c15431bb 100644 --- a/.github/workflows/gem-install.yml +++ b/.github/workflows/gem-install.yml @@ -64,6 +64,21 @@ jobs: - 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" + darwin-install: needs: ["package"] runs-on: macos-latest From 1dc1c5cf9aef03cb5047090adc41f2e5caf60d28 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 19 Sep 2022 13:59:40 -0400 Subject: [PATCH 4/4] fix: explicitly cast the platform string to a Gem::Platform to work around https://github.com/rubygems/rubygems/issues/5938 Closes #200 --- lib/tailwindcss/commands.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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?