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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +2 -2
- data/lib/runger_release_assistant/version.rb +1 -1
- data/lib/runger_release_assistant.rb +25 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36d17692f73d92c5a6b3984689b59032f1ed495660c2a1d6471514bb749121ce
|
4
|
+
data.tar.gz: 1a46989fa26d35079a316269220e86d02a1ea4c28dfd94c9ad8b38dafb99c59f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a8cfaf98881f7f9aacc27c88e1068390b83fcede377c17207dd296ca6021009c86a6df1eac2b61858b58078b3fb246222cef7d85c23df7595e47070700a92b2
|
7
|
+
data.tar.gz: 0e8b4ef1c0fe03a3747b127e3d7adbf40140bff458ab686435afc1bbea30b0b4e886ccd163015989e65790c9d59d245d79e4ab17ecd57cf58add4727ecdb06a2
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -9,7 +9,7 @@ GIT
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
runger_release_assistant (4.3.
|
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.
|
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
|
@@ -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
|
-
|
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
|
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
|
-
|
149
|
-
|
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
|
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
|
-
|
345
|
+
CHANGELOG_FILE_NAME
|
329
346
|
end
|
330
347
|
|
331
348
|
memo_wise \
|