chore: Another attempt to fix the releaser (#2220)

This commit is contained in:
Daniel Azuma 2021-01-06 16:37:33 -08:00 committed by GitHub
parent 4c9181f8dd
commit b56bfff57d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 12 deletions

View File

@ -17,7 +17,6 @@ class Releaser
@docuploader_credentials = File.join(ENV["KOKORO_KEYSTORE_DIR"], "73713_docuploader_service_account") @docuploader_credentials = File.join(ENV["KOKORO_KEYSTORE_DIR"], "73713_docuploader_service_account")
end end
@dry_run = dry_run ? true : false @dry_run = dry_run ? true : false
@rubygems_api_token_configured = false
@bundle_updated = false @bundle_updated = false
end end
@ -36,7 +35,6 @@ class Releaser
end end
def publish_gem def publish_gem
configure_rubygems_api_token
Dir.chdir(gem_dir) do Dir.chdir(gem_dir) do
FileUtils.rm_rf("pkg") FileUtils.rm_rf("pkg")
isolate_bundle do isolate_bundle do
@ -111,17 +109,14 @@ class Releaser
end end
def gems_client def gems_client
@gems_client ||= Gems::Client.new @gems_client ||= begin
end if rubygems_api_token
Gems.configure do |config|
def configure_rubygems_api_token config.key = rubygems_api_token
return if @rubygems_api_token_configured end
@rubygems_api_token_configured = true puts "Configured rubygems api token of length #{rubygems_api_token.length}"
if rubygems_api_token
Gems.configure do |config|
config.key = rubygems_api_token
end end
puts "Configured rubygems api token" Gems::Client.new
end end
end end