Skip to content

Adopt scientist-labs/rust-gem-release@v0 for releases - #3

Merged
xrl merged 5 commits into
mainfrom
migrate-to-rust-gem-release
Jun 19, 2026
Merged

xrl merged 5 commits into
mainfrom
migrate-to-rust-gem-release

Conversation

@xrl

@xrl xrl commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Adopt scientist-labs/rust-gem-release@v0

Migrates spellkit's release pipeline to the shared scientist-labs/rust-gem-release reusable workflow (pinned @v0, a moving major → currently rust-gem-release 0.2.0). Today spellkit ships source-only; after this the release publishes precompiled fat gems for arm64-darwin, x86_64-linux, and aarch64-linux plus the source gem, with a GitHub Release attached.

This is the generic (non-aliasing) adopter case: gem-name == ext-name == gemspec basename == spellkit, so ext-name / gemspec / platform-gem-env all resolve to their defaults and are omitted from the caller.

Files changed

  • .github/workflows/release.yml (new) — thin caller pinned @v0. Triggers on tag-push (4 canonical patterns) and workflow_dispatch. gem-name: spellkit, version-command: ruby -r./lib/spellkit/version -e 'print SpellKit::VERSION', permissions: contents: write.
  • .github/workflows/build.yml (new) — PR-CI caller @v0 running bundle exec rake spec. Supersedes ci.yml.
  • .github/workflows/ci.yml (deleted) — hand-rolled PR-CI, replaced by build.yml.
  • lib/spellkit.rb (prereq) — ABI require-shim.
  • spellkit.gemspec (prereq) — env-gated platform branch.

Prerequisites added (both were absent — required or the precompiled gems publish but fail to load)

  1. ABI require-shim in lib/spellkit.rb. The old shim fell back to require "spellkit.bundle", which never matches the darwin packaging path lib/spellkit/<minor>/spellkit.bundle. Now loads the versioned subdir first (require "spellkit/#{minor}/spellkit"), then falls back to the flat spellkit/spellkit for source/dev builds. Uses $LOAD_PATH (require, not require_relative).
  2. Gemspec platform gate in spellkit.gemspec. When ENV["RUST_GEM_PLATFORM"] is set: spec.platform = that, spec.extensions = [], and the compiled *.bundle/*.so are added to spec.files. Otherwise the normal source-gem extensions = ["ext/spellkit/extconf.rb"]. Verified both modes load: source → extensions=["ext/spellkit/extconf.rb"], platform=ruby; RUST_GEM_PLATFORM=arm64-darwin → extensions=[], platform=arm64-darwin.

Safety

  • publish defaults to DRY-RUN on workflow_dispatch (default: false) and is gated on tag-push (github.event_name == 'push' || inputs.publish).
  • Tag-push publishing is token-gated: rubygems-api-key maps to secrets.RUBYGEMS_API_KEY; an empty/absent token is a clean no-op skip in the shared workflow (required: false).
  • No x86_64-cargo-config / darwin-verify-cmd needed — spellkit's Rust deps (magnus, hashbrown, unicode-normalization, regex) are pure-CPU portable glibc builds; no TLS/Metal/CUDA/musl.

Proven template

Mirrors red-candle 1.8.0, the capstone migration whose 4-platform release went green on this same @v0 workflow.


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

xrl and others added 3 commits June 18, 2026 14:31
Migrate spellkit to the shared rust-gem-release reusable workflow so it
publishes precompiled fat gems (arm64-darwin + x86_64-linux + aarch64-linux)
alongside the source gem, instead of source-only.

- .github/workflows/release.yml: thin caller pinned @v0 (tag-push + manual
  dispatch). publish defaults to DRY-RUN on workflow_dispatch and is gated on
  tag-push; rubygems-api-key maps to RUBYGEMS_API_KEY (empty token = no-op).
- .github/workflows/build.yml: PR-CI caller @v0 (rake spec); replaces ci.yml.
- .github/workflows/ci.yml: removed (superseded by build.yml).
- lib/spellkit.rb: ABI require-shim — load versioned subdir
  lib/spellkit/<minor>/spellkit first, fall back to the flat path, so
  precompiled fat gems actually load.
- spellkit.gemspec: ENV["RUST_GEM_PLATFORM"] platform branch so the
  platform gems clear extensions and ship the compiled bundles/.so.

Proven template: red-candle 1.8.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Guard the dev-only rspec require so the Rakefile loads in the rb-sys-dock
cross container (RUNTIME bundle only), and declare cross_compile +
cross_platform on the rake-compiler ExtensionTask so the shared
rust-gem-release matrix can build x86_64-linux / aarch64-linux /
arm64-darwin precompiled gems.

Caller: add a label-gated pull_request dry-run (types incl. labeled) so a
PR labeled dry-run-release validates the full publish=false matrix before
merge; gate the calling job on that label; make publish robust so a PR is
never a publish (only push tags, or workflow_dispatch with inputs.publish).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xrl xrl added the dry-run-release Run the full precompiled release matrix as a publish=false dry-run on this PR label Jun 18, 2026
@xrl
xrl marked this pull request as ready for review June 18, 2026 20:22
Retire the moving @v0 tag in favor of the explicit latest release.
Updates both release.yml and build.yml callers and their doc comments.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xrl xrl added dry-run-release Run the full precompiled release matrix as a publish=false dry-run on this PR and removed dry-run-release Run the full precompiled release matrix as a publish=false dry-run on this PR labels Jun 18, 2026
@xrl
xrl merged commit 54fbde1 into main Jun 19, 2026
21 of 23 checks passed
@xrl
xrl deleted the migrate-to-rust-gem-release branch June 19, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dry-run-release Run the full precompiled release matrix as a publish=false dry-run on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant