Publishing the smbcloud-model gem
Synced from docs/gems.md on the main branch of
smbcloud-cli . Edit it there.
The gem wraps the smbcloud-model Rust crate via a native extension. Publishing requires coordinating the Rust crate release and the gem release in order.
Prerequisites
- Rust toolchain installed
bundlerandgemCLI available- RubyGems account with push access to
smbcloud-model
Steps
1. Publish the Rust crate
Publish smbcloud-model to crates.io first. The gem’s native extension depends on it.
cargo publish -p smbcloud-model2. Update the Cargo dependency
Switch gems/model/ext/model/Cargo.toml from the local path to the published version:
# Before (development)
smbcloud-model = { path = "./../../../../crates/smbcloud-model" }
# After (release) — match the version just published
smbcloud-model = "0.3"3. Sync the gem version
Set gems/model/lib/model/version.rb to match the smbcloud-model crate version:
module Model
VERSION = '0.3.31'
end4. Compile the native extension
cd gems/model
bundle exec rake compile5. Build the gem
bundle exec rake buildThis produces pkg/smbcloud-model-<version>.gem.
6. Publish the gem
gem push pkg/smbcloud-model-<version>.gemDevelopment workflow
To work against the local crate instead of the published one, use the path dependency:
smbcloud-model = { path = "./../../../../crates/smbcloud-model" }Remember to revert this before publishing.