runger_release_assistant 4.2.1 → 4.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e5cf7362dd12d923b88713f84240ed0d110a0aebcaa02fb64f093894ba7f468
4
- data.tar.gz: c0986cb869c96542d2fb9cc4e40f8f95da9d4759c871ff2bbd7819b3cd5597c8
3
+ metadata.gz: 36d17692f73d92c5a6b3984689b59032f1ed495660c2a1d6471514bb749121ce
4
+ data.tar.gz: 1a46989fa26d35079a316269220e86d02a1ea4c28dfd94c9ad8b38dafb99c59f
5
5
  SHA512:
6
- metadata.gz: 7fe5c293094adc5ddeb32e45e853bca02936620698a187be3247bbfd677c0224ba1741bd82ca2292a196ba7423f26b8fb16c7eecb91d89678dcb25a80950ea42
7
- data.tar.gz: f1ebfe8c4fd71a3fe084c2aa0d1e613fd2fbe935bb52c465abb5df6b333f9f22f7064d1a5677c261d518b616f0b2ce3e0ef8542b0f95a9d68e90ba6fa2e6c562
6
+ metadata.gz: 8a8cfaf98881f7f9aacc27c88e1068390b83fcede377c17207dd296ca6021009c86a6df1eac2b61858b58078b3fb246222cef7d85c23df7595e47070700a92b2
7
+ data.tar.gz: 0e8b4ef1c0fe03a3747b127e3d7adbf40140bff458ab686435afc1bbea30b0b4e886ccd163015989e65790c9d59d245d79e4ab17ecd57cf58add4727ecdb06a2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## Unreleased
2
2
  [no unreleased changes yet]
3
3
 
4
+ ## v4.3.1 (2025-03-20)
5
+ [no unreleased changes yet]
6
+
7
+ ## v4.3.0 (2025-03-20)
8
+ - Only use the RubyGems bundler release rake sub-tasks needed to push to RubyGems.
9
+
4
10
  ## v4.2.1 (2025-03-20)
5
11
  ### Docs
6
12
  - [README] Update table of contents.
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- runger_release_assistant (4.2.1)
12
+ runger_release_assistant (4.3.1)
13
13
  activesupport (>= 6)
14
14
  memo_wise (>= 1.7)
15
15
  rainbow (>= 3.0)
@@ -102,8 +102,8 @@ GEM
102
102
  rubocop-ast (>= 1.38.0, < 2.0)
103
103
  ruby-progressbar (~> 1.7)
104
104
  unicode-display_width (>= 2.4.0, < 4.0)
105
- rubocop-ast (1.39.0)
106
- parser (>= 3.3.1.0)
105
+ rubocop-ast (1.41.0)
106
+ parser (>= 3.3.7.2)
107
107
  rubocop-performance (1.24.0)
108
108
  lint_roller (~> 1.1)
109
109
  rubocop (>= 1.72.1, < 2.0)
@@ -185,12 +185,12 @@ CHECKSUMS
185
185
  rspec-mocks (3.13.2) sha256=2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef
186
186
  rspec-support (3.13.2) sha256=cea3a2463fd9b84b9dcc9685efd80ea701aa8f7b3decb3b3ce795ed67737dbec
187
187
  rubocop (1.74.0) sha256=06138a35d7d11c963d5abc0148b355e3999007cb0225a619940db0e75521379b
188
- rubocop-ast (1.39.0) sha256=b6ba0f677ceced033b81c69405ac8931f4963116c572b8da5e15a03619a8236c
188
+ rubocop-ast (1.41.0) sha256=0eeff9ad3743f42823e3c687cbc15f8c552ff63c9f8e3d35fbafe746977c7c0d
189
189
  rubocop-performance (1.24.0) sha256=e5bd39ff3e368395b9af886927cc37f5892f43db4bd6c8526594352d5b4440b5
190
190
  rubocop-rspec (3.5.0) sha256=710c942fe1af884ba8eea75cbb8bdbb051929a2208880a6fc2e2dce1eed5304c
191
191
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
192
192
  runger_byebug (11.4.0) sha256=569e22ba2215f57e7f69e145fcb63be401e29fcd312f7936d813e12d0c7bbee6
193
- runger_release_assistant (4.2.1)
193
+ runger_release_assistant (4.3.1)
194
194
  runger_style (5.7.0) sha256=200790f3998e0b924df17efc9d440ddec99508bae983ba2a63f42b80624762f0
195
195
  securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
196
196
  slop (4.10.1) sha256=844322b5ffcf17ed4815fdb173b04a20dd82b4fd93e3744c88c8fafea696d9c7
data/README.md CHANGED
@@ -141,17 +141,9 @@ By default, Git tags are created like `v1.0.0`. If you would like to prefix the
141
141
  tag_prefix: gem/
142
142
  ```
143
143
 
144
- You must also provide this to bundler by putting something like the following in your `Rakefile`:
145
-
146
- ```rb
147
- require 'bundler/gem_tasks'
148
- require 'runger_release_assistant'
149
- Bundler::GemHelper.tag_prefix = RungerReleaseAssistant.new.tag_prefix
150
- ```
151
-
152
144
  This example would generate tags in the form `gem/v1.0.0`.
153
145
 
154
- Note that all version numbers in git tags will be prefixed with at least a `v`. The `tag_prefix` option is to specify an additional prefix, in addition to the `v`.
146
+ Note that all version numbers in git tags will be prefixed with at least a `v`. The `tag_prefix` option is to specify another prefix, in addition to the `v`.
155
147
 
156
148
  ## Development
157
149
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  # rubocop:disable Style/StaticClass
4
4
  class RungerReleaseAssistant
5
- VERSION = '4.2.1'
5
+ VERSION = '4.3.1'
6
6
  end
7
7
  # rubocop:enable Style/StaticClass
@@ -43,6 +43,7 @@ class RungerReleaseAssistant
43
43
  end
44
44
  end
45
45
 
46
+ CHANGELOG_FILE_NAME = 'CHANGELOG.md'
46
47
  DEFAULT_OPTIONS = { rubygems: false }.freeze
47
48
 
48
49
  class << self
@@ -76,10 +77,12 @@ class RungerReleaseAssistant
76
77
  end
77
78
 
78
79
  def run_release
79
- ensure_on_main_branch
80
+ verify_on_main_branch
81
+ verify_repository_cleanliness
82
+ verify_changelog_present
83
+
80
84
  print_release_info
81
85
  confirm_release_looks_good
82
- verify_repository_cleanliness
83
86
 
84
87
  update_changelog_for_release
85
88
  update_version_file(next_version)
@@ -104,12 +107,18 @@ class RungerReleaseAssistant
104
107
 
105
108
  private
106
109
 
107
- def ensure_on_main_branch
110
+ def verify_on_main_branch
108
111
  if current_branch != primary_branch
109
112
  fail('You must be on the primary branch to release!')
110
113
  end
111
114
  end
112
115
 
116
+ def verify_changelog_present
117
+ if !File.exist?(changelog_path)
118
+ fail("You must have a changelog at #{changelog_path} .")
119
+ end
120
+ end
121
+
113
122
  def print_release_info
114
123
  logger.info("You are running the release process with options #{@options.to_h}.")
115
124
 
@@ -145,8 +154,16 @@ class RungerReleaseAssistant
145
154
  end
146
155
 
147
156
  def verify_repository_cleanliness
148
- fail 'There are unstaged changes!' if !system('git diff --exit-code')
149
- fail 'There are staged changes!' if !system('git diff-index --quiet --cached HEAD')
157
+ if git_is_clean?
158
+ @git_was_clean_initially = true
159
+ else
160
+ fail 'There are uncommitted changes!'
161
+ end
162
+ end
163
+
164
+ memo_wise \
165
+ def git_is_clean?
166
+ !system('test -n "$(git status --porcelain)"')
150
167
  end
151
168
 
152
169
  def current_branch
@@ -194,7 +211,7 @@ class RungerReleaseAssistant
194
211
  end
195
212
 
196
213
  def commit_changes(message:)
197
- execute_command("git add CHANGELOG.md Gemfile.lock #{version_file_path}")
214
+ execute_command("git add #{CHANGELOG_FILE_NAME} Gemfile.lock #{version_file_path}")
198
215
  execute_command("git commit -m '#{message}'")
199
216
  end
200
217
 
@@ -221,8 +238,11 @@ class RungerReleaseAssistant
221
238
 
222
239
  def push_to_rubygems
223
240
  logger.debug('Pushing to RubyGems and git')
224
- # Always show system output because 2FA should be enabled, which requires user to see the prompt
225
- execute_command('bundle exec rake release', show_system_output: true)
241
+ # Show system output because 2FA should be enabled, which requires the user to see the prompt.
242
+ execute_command(
243
+ 'bundle exec rake build release:guard_clean release:rubygem_push',
244
+ show_system_output: true,
245
+ )
226
246
  end
227
247
 
228
248
  def push_to_git
@@ -271,7 +291,7 @@ class RungerReleaseAssistant
271
291
  end
272
292
 
273
293
  def restore_and_abort(exit_code:)
274
- if current_branch == primary_branch
294
+ if (current_branch == primary_branch) && @git_was_clean_initially
275
295
  execute_command("git reset --hard origin/#{primary_branch}")
276
296
  end
277
297
 
@@ -322,7 +342,7 @@ class RungerReleaseAssistant
322
342
 
323
343
  memo_wise \
324
344
  def changelog_path
325
- file_path('CHANGELOG.md')
345
+ CHANGELOG_FILE_NAME
326
346
  end
327
347
 
328
348
  memo_wise \
@@ -40,6 +40,11 @@ Gem::Specification.new do |spec|
40
40
  spec.add_dependency('rake', '>= 13.2.1')
41
41
  spec.add_dependency('slop', '~> 4.8')
42
42
 
43
- required_ruby_version = File.read('.ruby-version').rstrip.sub(/\A(\d+\.\d+)\.\d+\z/, '\1.0')
43
+ # HACK: Using public_send rather than read works around a Dependabot bug.
44
+ # rubocop:disable Style/SendWithLiteralMethodName
45
+ required_ruby_version =
46
+ File.public_send(:read, '.ruby-version').
47
+ rstrip.sub(/\A(\d+\.\d+)\.\d+\z/, '\1.0')
48
+ # rubocop:enable Style/SendWithLiteralMethodName
44
49
  spec.required_ruby_version = ">= #{required_ruby_version}"
45
50
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runger_release_assistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-20 00:00:00.000000000 Z
10
+ date: 2025-03-21 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport