Skip to content

Commit 7af68b6

Browse files
committed
Enhance GitHub Actions workflow for native gems by adding support for macOS 13 and 25, including steps for repository checkout, downloading tessdata, and building the universal gem. Implement checks for gem file existence before publishing to RubyGems.
1 parent bc5b62f commit 7af68b6

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/native-gems.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
matrix:
1616
include:
1717
- platform: arm64-darwin-23
18+
runner: macos-13
19+
- platform: arm64-darwin-25
1820
runner: macos-latest
1921
- platform: x86_64-linux
2022
runner: ubuntu-22.04
@@ -54,20 +56,43 @@ jobs:
5456
permissions:
5557
contents: read
5658
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v5
61+
62+
- uses: ruby/setup-ruby@v1
63+
with:
64+
ruby-version: ruby
65+
bundler-cache: true
66+
5767
- name: Download all gem artifacts
5868
uses: actions/download-artifact@v4
5969
with:
6070
pattern: parsekit-bin-*
6171
merge-multiple: true
6272
path: pkg
6373

74+
- name: Download tessdata for build
75+
run: |
76+
mkdir -p tessdata
77+
curl -L https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata -o tessdata/eng.traineddata
78+
79+
- name: Build universal gem
80+
env:
81+
TESSDATA_PREFIX: ${{ github.workspace }}/tessdata
82+
run: bundle exec rake build
83+
6484
- name: Publish to RubyGems
6585
env:
6686
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
6787
run: |
6888
set -euo pipefail
6989
shopt -s nullglob
70-
for gem_file in pkg/*.gem; do
90+
gems=(pkg/*.gem)
91+
if [ ${#gems[@]} -eq 0 ]; then
92+
echo "No gem files found in pkg/. Nothing to publish."
93+
exit 1
94+
fi
95+
for gem_file in "${gems[@]}"; do
7196
echo "Pushing ${gem_file}"
7297
gem push "$gem_file"
7398
done

0 commit comments

Comments
 (0)