twingly / twingly-search-api-ruby

:gem: Twingly Blog Search API in Ruby

Home Page:https://developer.twingly.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Release gem to rubygems.org

jage opened this issue · comments

Let Travis-CI release the gem when tagging: http://docs.travis-ci.com/user/deployment/rubygems/

Update all depending Twingly projects Gemfile's when it's done.

$ travis setup rubygems
Detected repository as twingly/twingly-analytics-api-ruby, is this correct? |yes|
RubyGems API token: ********************************
Gem name: |twingly-analytics-api-ruby| twingly-analytics
Release only tagged commits? |yes|
Release only from twingly/twingly-analytics-api-ruby? |yes|
Encrypt API key? |yes|

Install instructions in the README should be updated as well.

Install instructions in the README should be updated as well.

Yes, waiting for gem exist on rubygems.org before updating!

Hmm, all builds have finished, but no new gem on https://rubygems.org/profiles/twingly.

https://travis-ci.org/twingly/twingly-analytics-api-ruby/jobs/59891537 displays

Fetching: dpl-1.7.11.gem (100%)
Successfully installed dpl-1.7.11
1 gem installed

Installing deploy dependencies

Fetching: gems-0.8.3.gem (100%)
Successfully installed gems-0.8.3
1 gem installed

Preparing deploy
Found gem 
/usr/lib/git-core/git-stash: 186: /usr/lib/git-core/git-stash: cannot create /home/travis/build/twingly/twingly-analytics-api-ruby/.git/logs/refs/stash: Directory nonexistent

Deploying application
WARNING:  open-ended dependency on rake (>= 0, development) is not recommended
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 0'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: twingly-analytics
  Version: 1.0.1
  File: twingly-analytics-1.0.1.gem

No stash found.

Slightly related npm/npm#7914 (has the same things about git stash)

Found http://stackoverflow.com/questions/22384152/pushing-gems-to-rubygems-via-travis which linked to travis-ci/travis-ci#1675 but it's supposed to be fixed (it's closed). Will email Travis support.

I think we should use Annotated Tags, pretty sure I pushed a lightweight tag.

Response from Travis CI support


Hi, Patrik,

Sorry for the tardy reply.

This is quite curious. I see https://travis-ci.org/twingly/twingly-analytics-api-ruby/jobs/59891534#L218 (and 3 others) building the gem, but not actually registering the gem. Right after that line, the deployment utility is pushing to rubygems.org. Unfortunately, there is nothing in the log, but my immediate suspicion is that the api key may not be correctly encrypted (and consequently decrypted).

Could you try "travis encrypt -r twingly/twingly-analytics-api-ruby API_KEY", and insert the key into .travis.yml? I've seen cases where the CLI failed to find the correct encryption key.

Thank you!


They also added (in another email)


I should also add that, since you have 4 jobs in the build matrix, you should consider adding an extra condition for deployment, probably on the Ruby version. Otherwise, 4 attempts will be made to upload the gem, and 3 would necessarily fail.


I was thinking about that myself, so that was helpful that they stated how it would behave.

I pushed an annotated tag now: $ git tag -a 1.0.1 -m "Version 1.0.1"

Still no gem on rubygems.org... followed up with travis ci support.

Travis CI support:

Thanks for checking. Hmm. Can I try decrypting your rubygems.org API key? I would like to compare what we are using with what you think we should be.

Me:

Sure

Travis CI support:

The decrypted API key starts with xxx and ends with xxx. Is it the right one?

Me:

Yes

Travis CI support:

Thanks for confirming. This is quite bizarre.

The deployment utility is expected to log whatever Gems.push (https://github.com/travis-ci/dpl/blob/f7925e384ff0b692232529cb946f1cbd1a6c027b/lib/dpl/provider/rubygems.rb#L44) call returns (e.g., https://travis-ci.org/travis-ci/dpl/jobs/59784780#L521). Your configuration appears correct to me, so I tend to think that there is nothing coming from rubygems.org itself.

The next step would be to get in touch with rubygems.org support and see if they can match up your build attempts with logs they have. (http://help.rubygems.org/) I believe they are in a better place to figure this out.

The plot thickens.

Have you tried to upload it manually? To verify that our API key is correct and the .gemspec is ok.

No, not this gem, but I have successfully uploaded other gems with our API key.

I can push it manually.

It worked: https://rubygems.org/gems/twingly-analytics

$ chruby 2.2.2
$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
$ rm Gemfile.lock
rm: Gemfile.lock: No such file or directory
$ bundle
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.4.2
Using addressable 2.3.8
Using safe_yaml 1.0.4
Using crack 0.4.2
Using diff-lcs 1.2.5
Using multipart-post 2.0.0
Using faraday 0.9.1
Using mini_portile 0.6.2
Installing nokogiri 1.6.6.2
Installing rspec-support 3.2.2
Installing rspec-core 3.2.3
Installing rspec-expectations 3.2.1
Installing rspec-mocks 3.2.1
Installing rspec 3.2.0
Installing rspec-its 1.2.0
Using twingly-analytics 1.0.1 from source at .
Installing vcr 2.9.3
Installing webmock 1.21.0
Using bundler 1.9.4
Bundle complete! 6 Gemfile dependencies, 19 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ gem build twingly-analytics-api-ruby.gemspec
WARNING:  open-ended dependency on rake (>= 0, development) is not recommended
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 0'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: twingly-analytics
  Version: 1.0.1
  File: twingly-analytics-1.0.1.gem
$ gem push twingly-analytics-1.0.1.gem
Pushing gem to https://rubygems.org...
Successfully registered gem: twingly-analytics (1.0.1)

2.0.0 was built by travis (expand "Deploying application") but not published to rubygems

:-(