Skip to content

Commit 03a634c

Browse files
authored
Fix documentation build in release rake tasks (googleapis#2348)
* Don't rescue from docs build failures * Only publish docs if the gem push succeeded
1 parent 5ba0561 commit 03a634c

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎Rakefile‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -697,22 +697,27 @@ task :release, :tag do |t, args|
697697
end
698698

699699
path_to_be_pushed = "#{package}/pkg/#{package}-#{version}.gem"
700+
gem_was_published = nil
700701
if File.file? path_to_be_pushed
701702
begin
702703
::Gems.push(File.new path_to_be_pushed)
704+
gem_was_published = true
703705
puts "Successfully built and pushed #{package} for version #{version}"
704-
705-
# jsondoc:package needs jsondoc to have been run prior
706-
Rake::Task["bundleupdate"].invoke
707-
Rake::Task["jsondoc"].invoke
708-
Rake::Task["jsondoc:package"].invoke tag
709-
Rake::Task["docs:publish_tag"].invoke tag
710706
rescue => e
707+
gem_was_published = false
711708
puts "Error while releasing #{package} version #{version}: #{e.message}"
712709
end
713710
else
714711
fail "Cannot build #{package} for version #{version}"
715712
end
713+
714+
if gem_was_published
715+
# jsondoc:package needs jsondoc to have been run prior
716+
Rake::Task["bundleupdate"].invoke
717+
Rake::Task["jsondoc"].invoke
718+
Rake::Task["jsondoc:package"].invoke tag
719+
Rake::Task["docs:publish_tag"].invoke tag
720+
end
716721
end
717722

718723
desc "Run all integration tests"

0 commit comments

Comments
 (0)