From cc4d0337b224921dae1c6cac394512b9cd8245f3 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sun, 23 Mar 2025 16:03:49 -0400 Subject: [PATCH 1/3] ci: add Ruby 3.4 to the matrix --- .github/workflows/downstream.yml | 6 +++--- .github/workflows/main.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 853598e..474c838 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -27,15 +27,15 @@ jobs: - url: https://github.com/rails/tailwindcss-rails name: rails-unit command: "bin/test" - ruby: "3.3" + ruby: "3.4" - url: https://github.com/rails/tailwindcss-rails name: rails-install command: "env TAILWINDCSSOPTS=--path=../../.. test/integration/user_install_test.sh" - ruby: "3.3" + ruby: "3.4" - url: https://github.com/rails/tailwindcss-rails name: rails-upgrade command: "env TAILWINDCSSOPTS=--path=../../.. test/integration/user_upgrade_test.sh" - ruby: "3.3" + ruby: "3.4" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 943726e..0a3e0a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.0", "3.1", "3.2", "3.3", "head"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4", "head"] steps: - uses: actions/checkout@v4 - run: rm Gemfile.lock From c36ab70bcf0ac06e0bd1d7a647f3089bfdc32fe2 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sun, 23 Mar 2025 16:06:03 -0400 Subject: [PATCH 2/3] ci: Merge packaging workflow into main.yml --- .github/workflows/gem-install.yml | 113 ------------------------------ .github/workflows/main.yml | 99 +++++++++++++++++++++++++- 2 files changed, 98 insertions(+), 114 deletions(-) delete mode 100644 .github/workflows/gem-install.yml diff --git a/.github/workflows/gem-install.yml b/.github/workflows/gem-install.yml deleted file mode 100644 index 561f22d..0000000 --- a/.github/workflows/gem-install.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: packaging -concurrency: - group: "${{github.workflow}}-${{github.ref}}" - cancel-in-progress: true -on: - workflow_dispatch: - push: - branches: - - main - - v4.x - tags: - - v*.*.* - pull_request: - types: [opened, synchronize] - branches: - - '*' - -jobs: - package: - name: "package (${{ matrix.platform }})" - strategy: - fail-fast: false - matrix: - platform: - - "ruby" - - "aarch64-linux-gnu" - - "aarch64-linux-musl" - - "arm64-darwin" - - "x64-mingw-ucrt" - - "x64-mingw32" - - "x86_64-darwin" - - "x86_64-linux-gnu" - - "x86_64-linux-musl" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: rm Gemfile.lock - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2" - bundler: latest - bundler-cache: true - - run: "bundle exec rake gem:${{matrix.platform}}" - - uses: actions/upload-artifact@v4 - with: - name: gem-${{matrix.platform}} - path: pkg - retention-days: 1 - - vanilla-install: - name: "install (ruby)" - needs: ["package"] - runs-on: ubuntu-latest - steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2" - - uses: actions/download-artifact@v4 - with: - name: gem-ruby - path: pkg - - run: "gem install pkg/tailwindcss-ruby-*.gem" - - run: "tailwindcss 2>&1 | fgrep 'ERROR: Cannot find the tailwindcss executable'" - - install-matrix: - name: "install (${{ matrix.platform }})" - needs: [ "package" ] - strategy: - fail-fast: false - matrix: - ruby: [ "3.4" ] - platform: - - "aarch64-linux-gnu" - - "aarch64-linux-musl" - - "arm64-darwin" - - "x64-mingw-ucrt" - # - "x64-mingw32" # because it's on a different version of ruby, we just add it in an "include" below - - "x86_64-darwin" - - "x86_64-linux-gnu" - - "x86_64-linux-musl" - include: - - { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64/v8" } - - { platform: aarch64-linux-musl, docker_tag: "-alpine", docker_platform: "--platform=linux/arm64/v8", bootstrap: "apk add build-base &&" } - - { platform: arm64-darwin, runs_on: macos-14 } - - { platform: x64-mingw-ucrt, runs_on: windows-latest } - - { platform: x64-mingw32, runs_on: windows-latest, ruby: "3.0" } - - { platform: x86_64-darwin, runs_on: macos-13 } - - { platform: x86_64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add build-base &&" } - runs-on: ${{ matrix.runs_on || 'ubuntu-latest' }} - steps: - - uses: actions/download-artifact@v4 - with: - name: gem-${{ matrix.platform }} - path: pkg - - if: ${{ matrix.runs_on }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - - if: ${{ matrix.runs_on }} - run: "gem install pkg/tailwindcss-ruby-*.gem" - - if: ${{ matrix.runs_on }} - run: "tailwindcss --help" - - if: ${{ (! matrix.runs_on) && matrix.docker_platform }} - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - if: ${{ ! matrix.runs_on }} - run: | - docker run --rm -v $PWD:/tailwindcss-ruby -w /tailwindcss-ruby \ - ${{ matrix.docker_platform }} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \ - sh -c " - ${{ matrix.bootstrap }} - gem install pkg/tailwindcss-ruby-*.gem - tailwindcss --help - " diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a3e0a8..68948dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ on: - '*' jobs: - build: + test: runs-on: ubuntu-latest strategy: fail-fast: false @@ -32,3 +32,100 @@ jobs: bundler-cache: true - name: Run tests run: bundle exec rake test + + package: + needs: [ "test" ] + name: "package (${{ matrix.platform }})" + strategy: + fail-fast: false + matrix: + platform: + - "ruby" + - "aarch64-linux-gnu" + - "aarch64-linux-musl" + - "arm64-darwin" + - "x64-mingw-ucrt" + - "x64-mingw32" + - "x86_64-darwin" + - "x86_64-linux-gnu" + - "x86_64-linux-musl" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rm Gemfile.lock + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + bundler: latest + bundler-cache: true + - run: "bundle exec rake gem:${{matrix.platform}}" + - uses: actions/upload-artifact@v4 + with: + name: gem-${{matrix.platform}} + path: pkg + retention-days: 1 + + install-ruby: + name: "install (ruby)" + needs: [ "package" ] + runs-on: ubuntu-latest + steps: + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + - uses: actions/download-artifact@v4 + with: + name: gem-ruby + path: pkg + - run: "gem install pkg/tailwindcss-ruby-*.gem" + - run: "tailwindcss 2>&1 | fgrep 'ERROR: Cannot find the tailwindcss executable'" + + install-native: + name: "install (${{ matrix.platform }})" + needs: [ "package" ] + strategy: + fail-fast: false + matrix: + ruby: [ "3.4" ] + platform: + - "aarch64-linux-gnu" + - "aarch64-linux-musl" + - "arm64-darwin" + - "x64-mingw-ucrt" + # - "x64-mingw32" # because it's on a different version of ruby, we just add it in an "include" below + - "x86_64-darwin" + - "x86_64-linux-gnu" + - "x86_64-linux-musl" + include: + - { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64/v8" } + - { platform: aarch64-linux-musl, docker_tag: "-alpine", docker_platform: "--platform=linux/arm64/v8", bootstrap: "apk add build-base &&" } + - { platform: arm64-darwin, runs_on: macos-14 } + - { platform: x64-mingw-ucrt, runs_on: windows-latest } + - { platform: x64-mingw32, runs_on: windows-latest, ruby: "3.0" } + - { platform: x86_64-darwin, runs_on: macos-13 } + - { platform: x86_64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add build-base &&" } + runs-on: ${{ matrix.runs_on || 'ubuntu-latest' }} + steps: + - uses: actions/download-artifact@v4 + with: + name: gem-${{ matrix.platform }} + path: pkg + - if: ${{ matrix.runs_on }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - if: ${{ matrix.runs_on }} + run: "gem install pkg/tailwindcss-ruby-*.gem" + - if: ${{ matrix.runs_on }} + run: "tailwindcss --help" + - if: ${{ (! matrix.runs_on) && matrix.docker_platform }} + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - if: ${{ ! matrix.runs_on }} + run: | + docker run --rm -v $PWD:/tailwindcss-ruby -w /tailwindcss-ruby \ + ${{ matrix.docker_platform }} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \ + sh -c " + ${{ matrix.bootstrap }} + gem install pkg/tailwindcss-ruby-*.gem + tailwindcss --help + " From 6e405d9db17f171594fc05ead922bf43e5208f34 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sun, 23 Mar 2025 16:06:31 -0400 Subject: [PATCH 3/3] ci: rename main.yml to ci.yml --- .github/workflows/{main.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{main.yml => ci.yml} (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/ci.yml