|
1 | | -name: native-gems |
| 1 | +name: Build & release precompiled gems |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
5 | 4 | push: |
6 | 5 | tags: |
7 | 6 | - "v*" |
8 | 7 |
|
9 | 8 | jobs: |
10 | 9 | build: |
11 | | - name: ${{ matrix.platform }} |
12 | | - runs-on: ${{ matrix.runner }} |
| 10 | + runs-on: ubuntu-latest |
13 | 11 | strategy: |
14 | | - fail-fast: false |
15 | 12 | matrix: |
16 | | - include: |
17 | | - - platform: x86_64-darwin |
18 | | - runner: macos-13 |
19 | | - - platform: arm64-darwin |
20 | | - runner: macos-14 |
21 | | - - platform: x86_64-linux |
22 | | - runner: ubuntu-22.04 |
23 | | - - platform: aarch64-linux |
24 | | - runner: ubuntu-22.04 |
25 | | - |
| 13 | + # Add/remove platforms as you need |
| 14 | + platform: |
| 15 | + - x86_64-linux |
| 16 | + - aarch64-linux |
| 17 | + - x86_64-linux-musl |
| 18 | + - x86_64-darwin |
| 19 | + - arm64-darwin |
| 20 | + - x64-mingw-ucrt |
26 | 21 | steps: |
27 | | - - uses: actions/checkout@v5 |
| 22 | + - uses: actions/checkout@v4 |
28 | 23 |
|
29 | | - - uses: ruby/setup-ruby@v1 |
| 24 | + # Sets up both Ruby and Rust for testing/build steps |
| 25 | + - uses: oxidize-rb/actions/setup-ruby-and-rust@v1 |
30 | 26 | with: |
31 | | - ruby-version: ruby |
| 27 | + ruby-version: "3.4" # match what you test/support |
32 | 28 | bundler-cache: true |
33 | 29 |
|
34 | | - - name: Download tessdata for build |
35 | | - run: | |
36 | | - mkdir -p tessdata |
37 | | - curl -L https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata -o tessdata/eng.traineddata |
38 | | -
|
39 | | - - name: Build native gem |
40 | | - env: |
41 | | - TESSDATA_PREFIX: ${{ github.workspace }}/tessdata |
42 | | - run: | |
43 | | - bundle exec rake "native:parsekit:${{ matrix.platform }}" |
| 30 | + # Build + package platform gems using rb-sys & rake-compiler-dock |
| 31 | + - name: Cross-compile gem |
| 32 | + uses: oxidize-rb/actions/cross-gem@v1 |
| 33 | + with: |
| 34 | + platform: ${{ matrix.platform }} |
| 35 | + # Optional: pass cargo features to toggle “bundled tesseract” vs system |
| 36 | + # cargo-features: "bundled-tesseract" |
44 | 37 |
|
45 | | - - name: Upload gem artifact |
| 38 | + - name: Upload artifacts |
46 | 39 | uses: actions/upload-artifact@v4 |
47 | 40 | with: |
48 | | - name: parsekit-${{ matrix.platform }} |
49 | | - path: pkg/*${{ matrix.platform }}.gem |
50 | | - if-no-files-found: error |
| 41 | + name: gem-${{ matrix.platform }} |
| 42 | + path: pkg/*.gem |
0 commit comments