lib/mcrt.rb in mcrt-1.0.0 vs lib/mcrt.rb in mcrt-1.1.0

- old
+ new

@@ -60,10 +60,17 @@ def close_repository(repository_id, description) post_request('https://oss.sonatype.org/service/local/staging/bulk/close', JSON.pretty_generate('data' => { 'description' => description, 'stagedRepositoryIds' => [repository_id] })) end + def promote_repository(repository_id, description) + post_request('https://oss.sonatype.org/service/local/staging/bulk/promote', + JSON.pretty_generate('data' => { 'autoDropAfterRelease' => true, + 'description' => description, + 'stagedRepositoryIds' => [repository_id] })) + end + def drop_repository(repository_id, description) post_request('https://oss.sonatype.org/service/local/staging/bulk/drop', JSON.pretty_generate('data' => { 'description' => description, 'stagedRepositoryIds' => [repository_id] })) end @@ -79,12 +86,10 @@ close_repository(candidate['repositoryId'], "Closing repository for #{project.name}") rescue raise 'Failed to close repository. It is likely that the release does not conform to Maven Central release requirements. Please visit the website https://oss.sonatype.org/index.html#stagingRepositories and manually complete the release.' end begin - #TODO: Implement the next method promote_repository(candidate['repositoryId'], "Promoting repository for #{project.name}") - drop_repository(candidate['repositoryId'], "Dropping repository for #{project.name}") rescue raise 'Failed to promote repository. Please visit the website https://oss.sonatype.org/index.html#stagingRepositories and manually complete the release.' end end end