@@ -21,6 +21,8 @@ task :create_release, %i[gem_version dry_run] do |_t, args|
21
21
args_hash = args . to_hash
22
22
23
23
is_dry_run = Release . object_to_boolean ( args_hash [ :dry_run ] )
24
+ puts "is_dry_run: #{ is_dry_run } " if is_dry_run
25
+
24
26
gem_version = args_hash . fetch ( :gem_version , '' ) . strip
25
27
npm_version = gem_version . empty? ? '' : Release . convert_rubygem_to_npm_version ( gem_version )
26
28
@@ -39,8 +41,9 @@ task :create_release, %i[gem_version dry_run] do |_t, args|
39
41
40
42
Release . commit_the_changes unless is_dry_run
41
43
44
+ Release . bump_gem_version ( gem_version , is_dry_run )
42
45
Release . release_the_new_npm_version ( npm_version , is_dry_run )
43
- Release . release_the_new_gem_version ( gem_version , is_dry_run )
46
+ Release . release_the_new_gem_version ( is_dry_run )
44
47
45
48
Release . push
46
49
end
@@ -55,6 +58,10 @@ module Release
55
58
56
59
# Executes a string or an array of strings in a shell in the given directory in an unbundled environment
57
60
def sh_in_dir ( dir , *shell_commands )
61
+ puts "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
62
+ puts "sh_in_dir, shell_commands = #{ shell_commands } "
63
+ puts "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
64
+
58
65
shell_commands . flatten . each { |shell_command | sh %(cd #{ dir } && #{ shell_command . strip } ) }
59
66
end
60
67
@@ -99,14 +106,17 @@ module Release
99
106
raise 'Ensure you have Git and Bundler installed before continuing.'
100
107
end
101
108
102
- def release_the_new_gem_version ( gem_version , is_dry_run )
109
+ def bump_gem_version ( gem_version , is_dry_run )
103
110
puts 'Bumping gem version'
104
111
Release . sh_in_dir (
105
112
gem_root ,
106
113
"gem bump --no-commit #{ gem_version == '' ? '' : %(--version #{ gem_version } ) } " ,
107
114
'bundle install' ,
108
- " git commit -am 'Bump version to #{ gem_version } '"
115
+ ( is_dry_run ? "" : " git commit -am 'Bump version to #{ gem_version } '")
109
116
)
117
+ end
118
+
119
+ def release_the_new_gem_version ( is_dry_run )
110
120
puts 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'
111
121
puts 'Use the OTP for RubyGems!'
112
122
puts 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'
@@ -115,7 +125,7 @@ module Release
115
125
end
116
126
117
127
def release_the_new_npm_version ( npm_version , is_dry_run )
118
- puts ' Making npm release'
128
+ puts " Making npm release, #{ is_dry_run ? 'dry run' : 'real run' } "
119
129
# Will bump the yarn version, commit, tag the commit, push to repo, and release on yarn
120
130
release_it_command = +'release-it'
121
131
release_it_command << " #{ npm_version } " unless npm_version == ''
0 commit comments