mcrt 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mcrt.rb +19 -4
  3. data/mcrt.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa22ad496b3e236444bd90443c83edb0bd3cbbc3
4
- data.tar.gz: 0eec7e3534d54514de465ff846a5a904ec5d6fcf
3
+ metadata.gz: b03889b8ee7f6c36ecb9e0d6546a10205c2f4f3b
4
+ data.tar.gz: 42b3d925c3ee60b21741374bcf16c8d10ed4ecac
5
5
  SHA512:
6
- metadata.gz: 6deed0a81a5d6d97b40d230ae2ac0da84b8bf75ec294e4c6f749df45c656cfa7a122de33e023f5beed28b70a20fd6e930da61dedaad65477780d64f264a9fa62
7
- data.tar.gz: 45f0dff1ee47ba70077ed3605254b76cedf462e13ec977864fe1688667055dddadd75c6a4d8c3af45554644a4ed493f81f70be9ccf356b1e639b32f81768727f
6
+ metadata.gz: 601c1aaf905bebd60cc8178435d1deb7f5ca80196253975d548aa47733f16e4aa57d96dae546ab5c600d27ed47e6c33dcf1aa5d62144edfdb0205b5e89f321df
7
+ data.tar.gz: 18530c1e355c6893bc68c68386923c1b39af8bef0740595e9d20a02e2a395d981c0bf3f5817c319d4b8f84d1db49deadb3eb37214cc790e3462feb6d4cfa9d49
data/lib/mcrt.rb CHANGED
@@ -46,14 +46,14 @@ class MavenCentralPublishTool
46
46
  @user_agent || "Ruby-#{RUBY_VERSION}"
47
47
  end
48
48
 
49
- def get_staging_repositories(profile_name)
49
+ def get_staging_repositories(profile_name, ignore_transitioning_repositories = true)
50
50
  result = get_request('https://oss.sonatype.org/service/local/staging/profile_repositories')
51
51
  result = JSON.parse(result)
52
52
  result['data'].select do |repo|
53
53
  repo['profileName'] == profile_name &&
54
54
  repo['userId'] == self.username &&
55
55
  repo['userAgent'] == self.user_agent &&
56
- repo['description'] == 'Implicitly created (auto staging).'
56
+ (!ignore_transitioning_repositories || !repo['transitioning'])
57
57
  end
58
58
  end
59
59
 
@@ -82,20 +82,35 @@ class MavenCentralPublishTool
82
82
  raise 'Release process found multiple staging repositories that could be the release just uploaded. Please visit the website https://oss.sonatype.org/index.html#stagingRepositories and manually complete the release.'
83
83
  else
84
84
  candidate = candidates[0]
85
+ puts "Requesting close of staging repository #{profile_name}:#{candidate['repositoryId']}"
85
86
  begin
86
- close_repository(candidate['repositoryId'], "Closing repository for #{project.name}")
87
+ close_repository(candidate['repositoryId'], "Closing repository for #{profile_name}")
87
88
  rescue Exception => e
88
89
  puts "#{e.class.name}: #{e.message}"
89
90
  puts e.backtrace.join("\n")
90
91
  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.'
91
92
  end
93
+ while get_staging_repositories(profile_name).size == 0
94
+ puts 'Waiting for repository to close...'
95
+ sleep 1
96
+ end
97
+ puts "Requesting promotion of staging repository #{profile_name}:#{candidate['repositoryId']}"
92
98
  begin
93
- promote_repository(candidate['repositoryId'], "Promoting repository for #{project.name}")
99
+ promote_repository(candidate['repositoryId'], "Promoting repository for #{profile_name}")
94
100
  rescue Exception => e
95
101
  puts "#{e.class.name}: #{e.message}"
96
102
  puts e.backtrace.join("\n")
97
103
  raise 'Failed to promote repository. Please visit the website https://oss.sonatype.org/index.html#stagingRepositories and manually complete the release.'
98
104
  end
105
+ repositories = get_staging_repositories(profile_name, false)
106
+ while repositories.size == 1
107
+ puts "Waiting for repository to be promoted..."
108
+ sleep 1
109
+ if repositories[0][:notifications] != 0
110
+ raise 'Failed to promote repository. Please visit the website https://oss.sonatype.org/index.html#stagingRepositories and manually complete the release.'
111
+ end
112
+ repositories = get_staging_repositories(profile_name, false)
113
+ end
99
114
  end
100
115
  end
101
116
 
data/mcrt.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{mcrt}
5
- s.version = '1.2.0'
5
+ s.version = '1.3.0'
6
6
  s.platform = Gem::Platform::RUBY
7
7
 
8
8
  s.authors = ['Peter Donald']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcrt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Donald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-12 00:00:00.000000000 Z
11
+ date: 2017-10-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Maven Central Release Tool.
14
14
  email: peter@realityforge.org