Skip to content

Publish the smbcloud-email gem - #93

Merged
setoelkahfi merged 3 commits into
developmentfrom
feature/publish-email-gem
Oct 24, 2026
Merged

setoelkahfi merged 3 commits into
developmentfrom
feature/publish-email-gem

Conversation

@setoelkahfi

@setoelkahfi setoelkahfi commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Gets smbcloud-email ready for its first RubyGems release, using the same fixes #91 applied to smbcloud-auth and smbcloud-model.

What was wrong with the email gem:

  • ext/email/Cargo.toml asked for smbcloud-email-sdk = "0.4", but the crate is at 0.7.6.
  • magnus 0.7.1 does not build on Ruby 4.0.
  • The gemspec packaged the .ruby-version symlink, so the source gem would not install.
  • rb_sys ~> 0.9.91 let darwin bundles get an empty install name.
  • The gem was not in release-sdk-gem.yml.

Changes:

  • magnus 0.8, smbcloud-email-sdk 0.7, and the ruby() helper in lib.rs for the deprecated exception constructors. Clippy is clean.
  • rb_sys >= 0.9.130, build.rs removed, .ruby-version and .rubocop.yml left out of the package.
  • Cross-compile for x86_64-linux, aarch64-linux, arm64-darwin and x86_64-darwin, with the per-Ruby-minor loader in lib/email.rb.
  • Removed the [patch.crates-io] path override from sdk/gems/email/Cargo.toml. It ships in the source gem and points outside it, so cargo failed during gem install. Without it the gem resolves smbcloud-email-sdk from crates.io like auth and model do.
  • release-sdk-gem.yml builds and pushes email, and waits for smbcloud-email-sdk on crates.io. The version sync and drift scripts cover the email crate requirement.

Checked locally: rake build, then a source gem install into a temp dir on Ruby 3.4.2 and 4.0.7. require "email" loads, the client builds, and a bad key raises SmbCloud::Email::Error (401). The package has no symlinks. check-release-versions.mjs and actionlint pass.

Pushing now uses RubyGems trusted publishing instead of the RUBYGEMS_API_KEY secret: the push job has id-token: write and calls rubygems/[email protected]. Before dispatching a release, someone who owns the gems has to register trusted publishers on rubygems.org for smbcloudXYZ/smbcloud-cli, workflow release-sdk-gem.yml, no environment: one on each of smbcloud-auth and smbcloud-model, and a pending publisher for smbcloud-email.

To publish after merge, dispatch SDK Ruby Gem Release with tag=v0.7.6, ref=development. auth and model 0.7.6 get skipped as already pushed.

Give sdk/gems/email the same treatment auth and model got in #91 so it can
ship to RubyGems as a fat native gem.

- Build with magnus 0.8 (0.7.1 does not compile on Ruby 4.0) and depend on
  smbcloud-email-sdk 0.7 instead of the 0.4 that no longer matches the crate.
- Require rb_sys >= 0.9.130, which sets the darwin install name, and drop
  build.rs.
- Cross-compile for four platforms and load the per-Ruby-minor extension with
  a fallback to the single-ABI path.
- Stop packaging .ruby-version, a symlink that made the source gem
  uninstallable.
- Remove the [patch.crates-io] path override from the gem workspace. It ships
  in the source gem and points outside it, so cargo fails on install.
- Add the gem to release-sdk-gem.yml and to the version sync and drift
  checks.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@paydii
paydii requested review from keypair34 and paydii October 24, 2026 11:12

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change prepares the smbcloud-email gem for its first RubyGems release, aligning it with fixes previously applied to smbcloud-auth and smbcloud-model. It updates dependencies (magnus 0.8, smbcloud-email-sdk 0.7, rb_sys >= 0.9.130), removes problematic symlinks from the gem package, ensures correct cross-compilation for multiple platforms, and updates the loader logic in lib/email.rb to support per-Ruby-minor ABI bundles. The release workflow is updated to build and publish the email gem, and the version sync/drift scripts now cover the email gem's crate requirement. The Cargo.toml patch override is removed to allow proper resolution from crates.io. The Rust extension now uses the Ruby thread-safe exception constructors required by magnus 0.8. All changes are consistent with the description and prior review threads appear addressed.


Automated review by siGit Code Review · commit f612fd5 · see the review dashboard

@setoelkahfi setoelkahfi self-assigned this Oct 24, 2026
setoelkahfi and others added 2 commits October 24, 2026 13:15
Replace the RUBYGEMS_API_KEY secret with an OIDC exchange through
rubygems/configure-rubygems-credentials. The push job gets id-token: write
and the key is short lived. This also removes the problem of a scoped key
refusing the first push of a new gem: smbcloud-email can use a pending
trusted publisher instead.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
development moved gem PR checks out of release-sdk-gem.yml and into ci.yml
(#92), so drop the sdk/gems path triggers from the release workflow and add
the email gem to the ci.yml filter and the cross-build, smoke-test and
source-gem matrices instead.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update extends the CI and release workflows to support the new smbcloud-email Ruby gem, aligning it with the fixes and patterns already applied to smbcloud-auth and smbcloud-model. The CI workflow now builds, cross-compiles, and smoke-tests all three gems (auth, model, email) for multiple platforms and Ruby versions, and validates the source gem file lists. The release workflow switches to RubyGems trusted publishing (OIDC) and documents the need for trusted publisher setup for each gem, including the new email gem. The changes are mostly additive, modularizing the gem jobs and ensuring robust checks for packaging and installation. No previous findings are reintroduced or made worse by these changes.


Automated review by siGit Code Review · commit 10c7579 · changes since f612fd5 · see the review dashboard

@setoelkahfi
setoelkahfi merged commit fbdb156 into development Oct 24, 2026
57 checks passed
@setoelkahfi
setoelkahfi deleted the feature/publish-email-gem branch October 24, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants