Publish Ruby SDKs manually
This guide covers publishing Ruby SDKs manually. For information on automating Ruby SDK publishing, see Publish Ruby SDKs automatically.
To share your generated Ruby SDK with the community, you can publish it to RubyGems. This enables other developers to easily install it using the gem install command. Follow the steps below to publish your SDK to RubyGems.
Publish your Ruby SDK to RubyGems
To publish your SDK to RubyGems, do the following:
-
If you haven’t done so, create a RubyGems account:
- Register at RubyGems.
- Set up your API credentials:
-
Prepare your gem for publishing:
This creates
your-sdk-1.0.0.gemin the current directory. -
Validate the gem:
-
Publish to RubyGems:
-
Verify publication:
Publish updates
-
Update the version in
lib/your_sdk/version.rb: -
Update
CHANGELOG.mdwith changes. -
Build and publish:
Best practices for publishing Ruby SDKs
Use the following best practices when publishing your Ruby SDK to RubyGems:
- Use semantic versioning (
MAJOR.MINOR.PATCH). - Maintain a
CHANGELOG.mddocumenting changes. - Use YARD documentation comments for API documentation.
- Follow Ruby style guidelines (use RuboCop).
- Pin major versions of dependencies in your gemspec.
- Include metadata URLs in your gemspec for better discoverability.
- Test your gem installation in a clean environment before publishing.