|
| 1 | +name: packaging |
| 2 | +concurrency: |
| 3 | + group: "${{github.workflow}}-${{github.ref}}" |
| 4 | + cancel-in-progress: true |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + tags: |
| 11 | + - v*.*.* |
| 12 | + pull_request: |
| 13 | + types: [opened, synchronize] |
| 14 | + branches: |
| 15 | + - '*' |
| 16 | + |
| 17 | +jobs: |
| 18 | + package: |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + platform: ["ruby", "x64-mingw32", "x64-mingw-ucrt", "x86_64-darwin", "arm64-darwin", "x86_64-linux", "arm-linux"] |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - run: rm Gemfile.lock |
| 27 | + - uses: ruby/setup-ruby@v1 |
| 28 | + with: |
| 29 | + ruby-version: "3.2" |
| 30 | + bundler: latest |
| 31 | + bundler-cache: true |
| 32 | + - run: "bundle exec rake gem:${{matrix.platform}}" |
| 33 | + - uses: actions/upload-artifact@v4 |
| 34 | + with: |
| 35 | + name: gem-${{matrix.platform}} |
| 36 | + path: pkg |
| 37 | + retention-days: 1 |
| 38 | + |
| 39 | + vanilla-install: |
| 40 | + needs: ["package"] |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - uses: ruby/setup-ruby@v1 |
| 44 | + with: |
| 45 | + ruby-version: "3.2" |
| 46 | + - uses: actions/download-artifact@v4 |
| 47 | + with: |
| 48 | + name: gem-ruby |
| 49 | + path: pkg |
| 50 | + - run: "gem install pkg/tailwindcss-rails-*.gem" |
| 51 | + - run: "tailwindcss 2>&1 | fgrep 'ERROR: Cannot find the tailwindcss executable'" |
| 52 | + |
| 53 | + linux-install: |
| 54 | + needs: ["package"] |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: ruby/setup-ruby@v1 |
| 58 | + with: |
| 59 | + ruby-version: "3.2" |
| 60 | + - uses: actions/download-artifact@v4 |
| 61 | + with: |
| 62 | + name: gem-x86_64-linux |
| 63 | + path: pkg |
| 64 | + - run: "gem install pkg/tailwindcss-rails-*.gem" |
| 65 | + - run: "tailwindcss --help" |
| 66 | + |
| 67 | + linux-musl-install: |
| 68 | + needs: ["package"] |
| 69 | + runs-on: ubuntu-latest |
| 70 | + container: |
| 71 | + image: ruby:3.2-alpine |
| 72 | + steps: |
| 73 | + - uses: actions/download-artifact@v4 |
| 74 | + with: |
| 75 | + name: gem-x86_64-linux |
| 76 | + path: pkg |
| 77 | + - run: "apk add build-base" # to compile racc, etc. |
| 78 | + - run: "gem update --system" # let's make sure the latest is working for us (upstream test, see #200) |
| 79 | + - run: "gem install pkg/tailwindcss-rails-*.gem" |
| 80 | + - run: "tailwindcss --help" |
| 81 | + |
| 82 | + linux-arm-install: |
| 83 | + needs: ["package"] |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - uses: actions/download-artifact@v4 |
| 87 | + with: |
| 88 | + name: gem-arm-linux |
| 89 | + path: pkg |
| 90 | + - run: | |
| 91 | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes |
| 92 | + docker run --rm -v "$(pwd):/test" -w /test --platform=linux/arm/v7 ruby:3.2 \ |
| 93 | + /bin/bash -c " |
| 94 | + set -ex |
| 95 | + gem install pkg/tailwindcss-rails-*.gem |
| 96 | + tailwindcss --help |
| 97 | + " |
| 98 | +
|
| 99 | + darwin-x86_64-install: |
| 100 | + needs: ["package"] |
| 101 | + runs-on: macos-13 |
| 102 | + steps: |
| 103 | + - uses: ruby/setup-ruby@v1 |
| 104 | + with: |
| 105 | + ruby-version: "3.2" |
| 106 | + - uses: actions/download-artifact@v4 |
| 107 | + with: |
| 108 | + name: gem-x86_64-darwin |
| 109 | + path: pkg |
| 110 | + - run: "gem install pkg/tailwindcss-rails-*.gem" |
| 111 | + - run: "tailwindcss --help" |
| 112 | + |
| 113 | + darwin-arm64-install: |
| 114 | + needs: ["package"] |
| 115 | + runs-on: macos-14 |
| 116 | + steps: |
| 117 | + - uses: ruby/setup-ruby@v1 |
| 118 | + with: |
| 119 | + ruby-version: "3.2" |
| 120 | + - uses: actions/download-artifact@v4 |
| 121 | + with: |
| 122 | + name: gem-arm64-darwin |
| 123 | + path: pkg |
| 124 | + - run: "gem install pkg/tailwindcss-rails-*.gem" |
| 125 | + - run: "tailwindcss --help" |
| 126 | + |
| 127 | + windows-install: |
| 128 | + needs: ["package"] |
| 129 | + runs-on: windows-latest |
| 130 | + steps: |
| 131 | + - uses: ruby/setup-ruby@v1 |
| 132 | + with: |
| 133 | + ruby-version: "3.0" |
| 134 | + - uses: actions/download-artifact@v4 |
| 135 | + with: |
| 136 | + name: gem-x64-mingw32 |
| 137 | + path: pkg |
| 138 | + - run: "gem install pkg/tailwindcss-rails-*.gem" |
| 139 | + - run: "tailwindcss --help" |
| 140 | + |
| 141 | + windows-ucrt-install: |
| 142 | + needs: ["package"] |
| 143 | + runs-on: windows-2022 |
| 144 | + steps: |
| 145 | + - uses: ruby/setup-ruby@v1 |
| 146 | + with: |
| 147 | + ruby-version: "3.2" |
| 148 | + - uses: actions/download-artifact@v4 |
| 149 | + with: |
| 150 | + name: gem-x64-mingw-ucrt |
| 151 | + path: pkg |
| 152 | + - run: "gem install pkg/tailwindcss-rails-*.gem" |
| 153 | + - run: "tailwindcss --help" |
0 commit comments