Adopt scientist-labs/rust-gem-release@v0 for releases#35
Merged
Conversation
Replace the hand-rolled workflow_dispatch release (manual version bump + commit + tag + single source gem build + RubyGems push) with a thin caller of the shared reusable workflow scientist-labs/rust-gem-release@v0, modeled on red-candle 1.8.0 (the proven template). A pushed version tag now builds the source gem + arm64-darwin + x86_64-linux precompiled fat gems (one ext per Ruby ABI), creates the GitHub Release, and conditionally publishes. Also add the two consumer prerequisites the precompiled gems need to load: - lib/parsekit.rb: ABI require-shim. Probe the Ruby-ABI-versioned native path (parsekit/<major.minor>/parsekit) first via $LOAD_PATH `require`, falling back to the flat parsekit/parsekit. The old require_relative form could never find the ext that a precompiled fat gem installs outside lib/. - parsekit.gemspec: env-gated platform branch on RUST_GEM_PLATFORM — when set, spec.platform = it, spec.extensions = [] (no recompile on install), and the per-ABI .bundle/.so are packed; else declare the extconf extension (normal source gem). Safety: aarch64-linux is disabled (build-aarch64-linux: false) — parsekit statically builds MuPDF + Tesseract/Leptonica from C/C++ source and the shared workflow's cross-gem aarch64 cross-build of that bundled-C++ stack is fragile; aarch64 users fall through to the source gem. publish defaults to a dry-run on manual dispatch; only a tag push publishes, and push no-ops when RUBYGEMS_API_KEY is empty. ci.yml is kept as the PR-CI path (it curls eng.traineddata + sets TESSDATA_PREFIX, which the shared build.yml cannot). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wire parsekit's release into the rust-gem-release@v0 cross-image path so BOTH linux legs (x86_64-linux + aarch64-linux) build precompiled gems instead of falling through to the source gem. - release.yml: set linux-cross-image-repo=ghcr.io/scientist-labs/rust-gem-cross (deps-enriched FROM rbsys/<platform>:0.9.128), flip build-aarch64-linux on (x86_64 already default-on), add the label-gated pull_request dry-run trigger + if-gate, raise job-timeout-minutes for the heavy MuPDF + bundled-Tesseract/Leptonica from-source compile, and make the publish expr robust (push or explicit dispatch opt-in only). - ext/parsekit/Cargo.lock: committed (force-added past gitignore), pins rb-sys to 0.9.128 so rb-sys-dock derives rbsys/<platform>:0.9.128 — the exact tag the workflow pre-seeds. No cargo-config/feature change needed: mupdf-sys finds cmake+libclang in the base image and tesseract-rs 0.2's bundled build needs only cmake+clang+network egress (all present); the union apt tesseract/leptonica dev libs are forward-compat for a future system-tesseract crate. - Rakefile: guard the dev-only rspec require in begin/rescue LoadError so the cross-gem build container (runtime bundle only) can load the Rakefile and run native:<platform>; gemspec already passed to ExtensionTask; cross_platform carries the x86_64-linux/aarch64-linux/arm64-darwin union. Runtime note (unchanged): the precompiled gem does not bundle eng.traineddata; OCR consumers still need system tessdata via TESSDATA_PREFIX. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrates parsekit's release pipeline to the shared reusable workflow scientist-labs/rust-gem-release, pinned @v0 (the moving-major alias, currently resolving to 0.2.0). This is the same template proven by red-candle 1.8.0, which shipped all four platforms to rubygems.org green on 2026-06-18.
The old
.github/workflows/release.ymlwas a hand-rolledworkflow_dispatch-only job that bumped the version, committed + tagged, built a single source gem, and pushed to RubyGems inline. It is replaced by a thin caller that, on a pushed version tag, builds:Each fat gem carries one compiled extension per Ruby ABI, so consumers install with no Rust toolchain.
Files changed
.github/workflows/release.yml(modify) — replaced the inline 61-line manual release with the canonical calleruses: scientist-labs/rust-gem-release/.github/workflows/release.yml@v0. Triggers on version tags +workflow_dispatch(publish default false). Inputs:gem-name: parsekit,version-command: ruby -r./lib/parsekit/version -e 'print ParseKit::VERSION',build-aarch64-linux: false,publish: ${{ github.event_name == 'push' || inputs.publish }}; secretrubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }};permissions: contents: write.lib/parsekit.rb(modify) — PREREQ Bump codecov/codecov-action from 4 to 5 #1: ABI require-shim. Probesparsekit/<major.minor>/parsekitfirst via$LOAD_PATHrequire, falling back to flatparsekit/parsekit. The oldrequire_relative "parsekit/parsekit"could never find the extension that a precompiled fat gem installs outsidelib/.parsekit.gemspec(modify) — PREREQ Bump actions/download-artifact from 4 to 5 #2: env-gated platform branch onRUST_GEM_PLATFORM. When set:spec.platform = it,spec.extensions = [], and the per-ABI.bundle/.soare packed; else declare theext/parsekit/extconf.rbextension (normal source gem).ci.ymlis kept as the PR-CI path (it curlseng.traineddataand exportsTESSDATA_PREFIX, which the sharedbuild.ymlhas no hook to do); nobuild.ymlcaller was added.Prereqs added
lib/parsekit.rbRUST_GEM_PLATFORM) inparsekit.gemspecBoth were absent before this PR — without them the precompiled gems would publish but never load (only the source gem would be usable).
Why aarch64-linux is off
parsekit's native extension statically builds MuPDF and Tesseract + Leptonica from C/C++ source (bundled-tesseract downloads source at build time). The shared workflow's aarch64 leg cross-compiles that bundled-C++ stack on an x86_64 host inside cross-gem's fixed image, which is fragile and may lack network for the source download.
build-aarch64-linux: falsekeeps a tag reliably yielding source + arm64-darwin + x86_64-linux; aarch64 users fall through to the source gem (which compiles on install). Flip it back on once the shared workflow grows a native-arm / prebuilt-sysroot path for C-heavy gems.Safety
workflow_dispatch,publishisfalseunless explicitly toggled on. Only a real version-tag push sets publishtrue.RUBYGEMS_API_KEYis empty the push step is a clean no-op.version-commandoutput (0.1.3); note the constant isParseKit(capital K).Template reference: red-candle 1.8.0.
DRAFT — do not merge until a publish=false dry-run is green; trigger with:
gh workflow run release.yml -f publish=false --ref migrate-to-rust-gem-release🤖 Generated with Claude Code