runger_release_assistant 4.3.0 → 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: 72ac278c16da0d5e98cda5bccea174aaf11ae0f90cbf81523c395d1b86c2de85
4
- data.tar.gz: e252541ae877d556c8eb374755d994d65003fdb9e4c6b60daaa6e5b290385d43
3
+ metadata.gz: 36d17692f73d92c5a6b3984689b59032f1ed495660c2a1d6471514bb749121ce
4
+ data.tar.gz: 1a46989fa26d35079a316269220e86d02a1ea4c28dfd94c9ad8b38dafb99c59f
5
5
  SHA512:
6
- metadata.gz: 0a0350178ce80ae6602fccf3b44f24d5ddf8187f828dbfa31613750fcdaec9b5329bcc32f77b1082c2ab18dfc0d7dc6955cc347f2879211297f2fff87b9caf66
7
- data.tar.gz: 07ce3e2bd9e5f51b1effe409e913e4fbf9ad6c1dad995309d53a5ecc41d3de053332b081ca089f3b607fa834361c59e4ee2da7e61ee8bbc8c56bb3a336af92df
6
+ metadata.gz: 8a8cfaf98881f7f9aacc27c88e1068390b83fcede377c17207dd296ca6021009c86a6df1eac2b61858b58078b3fb246222cef7d85c23df7595e47070700a92b2
7
+ data.tar.gz: 0e8b4ef1c0fe03a3747b127e3d7adbf40140bff458ab686435afc1bbea30b0b4e886ccd163015989e65790c9d59d245d79e4ab17ecd57cf58add4727ecdb06a2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  ## Unreleased
2
2
  [no unreleased changes yet]
3
3
 
4
+ ## v4.3.1 (2025-03-20)
5
+ [no unreleased changes yet]
6
+
4
7
  ## v4.3.0 (2025-03-20)
5
8
  - Only use the RubyGems bundler release rake sub-tasks needed to push to RubyGems.
6
9
 
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- runger_release_assistant (4.3.0)
12
+ runger_release_assistant (4.3.1)
13
13
  activesupport (>= 6)
14
14
  memo_wise (>= 1.7)
15
15
  rainbow (>= 3.0)
@@ -190,7 +190,7 @@ CHECKSUMS
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.3.0)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  # rubocop:disable Style/StaticClass
4
4
  class RungerReleaseAssistant
5
- VERSION = '4.3.0'
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
 
@@ -274,7 +291,7 @@ class RungerReleaseAssistant
274
291
  end
275
292
 
276
293
  def restore_and_abort(exit_code:)
277
- if current_branch == primary_branch
294
+ if (current_branch == primary_branch) && @git_was_clean_initially
278
295
  execute_command("git reset --hard origin/#{primary_branch}")
279
296
  end
280
297
 
@@ -325,7 +342,7 @@ class RungerReleaseAssistant
325
342
 
326
343
  memo_wise \
327
344
  def changelog_path
328
- file_path('CHANGELOG.md')
345
+ CHANGELOG_FILE_NAME
329
346
  end
330
347
 
331
348
  memo_wise \
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runger_release_assistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger