twingly / capistrano-twingly

:bookmark_tabs: Capistrano tasks used at Twingly

Home Page:https://rubygems.org/gems/capistrano-twingly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot published gem using "rake release"

roback opened this issue · comments

Since we started using 2FA for RubyGems we can't publish gems using bundle exec rake release. Rake gets stuck on the release:rubygem_push task, as shown when running with --trace:

$ bundle exec rake release --trace
** Invoke release (first_time)
** Invoke build (first_time)
** Execute build
capistrano-twingly 4.0.0 built to pkg/capistrano-twingly-4.0.0.gem.
** Invoke release:guard_clean (first_time)
** Execute release:guard_clean
** Invoke release:source_control_push (first_time)
** Execute release:source_control_push
Tag v4.0.0 has already been created.
** Invoke release:rubygem_push (first_time)
** Execute release:rubygem_push

Running gem push manually shows exactly what's happening:

$ gem push pkg/capistrano-twingly-4.0.0.gem
Pushing gem to https://rubygems.org...
You have enabled multi-factor authentication. Please enter OTP code.
Code:

After entering the 2FA/OTP code, the gem gets published successfully.

Here's the upstream issue for this: rubygems/bundler#6854

Here's the upstream issue for this: bundler/bundler#6854

And they have two outstanding PRs for it:

Progress is being made, rubygems/bundler#6854 was closed upstream by rubygems/bundler#7199 :)

Looks like the fix will be in Bundler v2.1 (twingly/twingly-url#139 (comment)). I've also changed our Rubygems settings to not require OTP code on gem push.