How do 'rubyists' automatically update their Gems on rubygems.org when they update their git branch?

StackOverflow https://stackoverflow.com/questions/23507034

  •  16-07-2023
  •  | 
  •  

Question

I heard about Github Services and Webhooks which sounded promising but when I visited the Services repo https://github.com/github/github-servicesI looked in the lib/services directory and didn't see anything relating to rubygems.org.

Then I checked the github webhook configuration screen (settings/hooks/new). They allow you to make http requests on a push event. So then I looked at the rubygems.org API. I see they have an endpoint for publishing gems:

POST - /api/v1/gems Submit a gem to RubyGems.org. Must post a built RubyGem in the request body.

In theory I could plug this into Github but the problem is RubyGems.org requires a prebuilt gem in order to publish. Whereas I just have a .gemspec file. Also, if I took this approach, how would I manage versioning on RubyGems.org? If possible I'd like to have the published gem version match the tag of the push.

Was it helpful?

Solution

Most people use CI (Continuous Integration) tools like https://travis-ci.org/ (Its free for public repos and I ain't advocating it) to do the building of gem, and scripts to make the gem push happen.

Refer to (the documentation talks about paid version of things. Not sure if its available in free for public repos):

http://docs.travis-ci.com/user/deployment/rubygems/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top