Skip to content

Commit c36ab70

Browse files
committed
ci: Merge packaging workflow into main.yml
1 parent cc4d033 commit c36ab70

File tree

2 files changed

+98
-114
lines changed

2 files changed

+98
-114
lines changed

.github/workflows/gem-install.yml

Lines changed: 0 additions & 113 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- '*'
1717

1818
jobs:
19-
build:
19+
test:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
fail-fast: false
@@ -32,3 +32,100 @@ jobs:
3232
bundler-cache: true
3333
- name: Run tests
3434
run: bundle exec rake test
35+
36+
package:
37+
needs: [ "test" ]
38+
name: "package (${{ matrix.platform }})"
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
platform:
43+
- "ruby"
44+
- "aarch64-linux-gnu"
45+
- "aarch64-linux-musl"
46+
- "arm64-darwin"
47+
- "x64-mingw-ucrt"
48+
- "x64-mingw32"
49+
- "x86_64-darwin"
50+
- "x86_64-linux-gnu"
51+
- "x86_64-linux-musl"
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- run: rm Gemfile.lock
56+
- uses: ruby/setup-ruby@v1
57+
with:
58+
ruby-version: "3.2"
59+
bundler: latest
60+
bundler-cache: true
61+
- run: "bundle exec rake gem:${{matrix.platform}}"
62+
- uses: actions/upload-artifact@v4
63+
with:
64+
name: gem-${{matrix.platform}}
65+
path: pkg
66+
retention-days: 1
67+
68+
install-ruby:
69+
name: "install (ruby)"
70+
needs: [ "package" ]
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: ruby/setup-ruby@v1
74+
with:
75+
ruby-version: "3.2"
76+
- uses: actions/download-artifact@v4
77+
with:
78+
name: gem-ruby
79+
path: pkg
80+
- run: "gem install pkg/tailwindcss-ruby-*.gem"
81+
- run: "tailwindcss 2>&1 | fgrep 'ERROR: Cannot find the tailwindcss executable'"
82+
83+
install-native:
84+
name: "install (${{ matrix.platform }})"
85+
needs: [ "package" ]
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
ruby: [ "3.4" ]
90+
platform:
91+
- "aarch64-linux-gnu"
92+
- "aarch64-linux-musl"
93+
- "arm64-darwin"
94+
- "x64-mingw-ucrt"
95+
# - "x64-mingw32" # because it's on a different version of ruby, we just add it in an "include" below
96+
- "x86_64-darwin"
97+
- "x86_64-linux-gnu"
98+
- "x86_64-linux-musl"
99+
include:
100+
- { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64/v8" }
101+
- { platform: aarch64-linux-musl, docker_tag: "-alpine", docker_platform: "--platform=linux/arm64/v8", bootstrap: "apk add build-base &&" }
102+
- { platform: arm64-darwin, runs_on: macos-14 }
103+
- { platform: x64-mingw-ucrt, runs_on: windows-latest }
104+
- { platform: x64-mingw32, runs_on: windows-latest, ruby: "3.0" }
105+
- { platform: x86_64-darwin, runs_on: macos-13 }
106+
- { platform: x86_64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add build-base &&" }
107+
runs-on: ${{ matrix.runs_on || 'ubuntu-latest' }}
108+
steps:
109+
- uses: actions/download-artifact@v4
110+
with:
111+
name: gem-${{ matrix.platform }}
112+
path: pkg
113+
- if: ${{ matrix.runs_on }}
114+
uses: ruby/setup-ruby@v1
115+
with:
116+
ruby-version: ${{ matrix.ruby }}
117+
- if: ${{ matrix.runs_on }}
118+
run: "gem install pkg/tailwindcss-ruby-*.gem"
119+
- if: ${{ matrix.runs_on }}
120+
run: "tailwindcss --help"
121+
- if: ${{ (! matrix.runs_on) && matrix.docker_platform }}
122+
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
123+
- if: ${{ ! matrix.runs_on }}
124+
run: |
125+
docker run --rm -v $PWD:/tailwindcss-ruby -w /tailwindcss-ruby \
126+
${{ matrix.docker_platform }} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \
127+
sh -c "
128+
${{ matrix.bootstrap }}
129+
gem install pkg/tailwindcss-ruby-*.gem
130+
tailwindcss --help
131+
"

0 commit comments

Comments
 (0)