runger_release_assistant 3.2.0 → 4.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5aab9f2fb1ddc54a55bbf183b140203ad9f100acce5f283c9490ef31869ff3ad
4
- data.tar.gz: 79cce0892a612bbb04db2496fbdd8c037ea880904fbc7cfe4c4e8e2cbf18f1b9
3
+ metadata.gz: 5ad2c73ce4962b251c902dbe5bdb69f65cd30efc604fa9de98ac16be34a964a9
4
+ data.tar.gz: ab3f19726d8156a7a16443e9898229c77a75a5b6a228d1a87ef8ae90c1b28d05
5
5
  SHA512:
6
- metadata.gz: e4941b764bb3f1874b2ce9c0dcaa34be27b4271dc560143fd27ec5f484e85b060dea6a02496ae407f063c028f9d399bd323d5a682e4585924291f7aa8070dc62
7
- data.tar.gz: f92c6e90bd2b1822c5a679661eb28ef7d432c7180dbca8e600fdc080b51e752ec10746c5aae42449a9fb52df97521e1fce3cf286e65f9644f11e1b8f0e6c41fb
6
+ metadata.gz: 84899c866e3fa6935233cdca4ac0f2dea0e032160b10091830d50efb0f9e4ada98c2edc3bebf70236b2280638e2867879b15183786a094b3f0a2a6a807435656
7
+ data.tar.gz: d6193ba1d6e26f48e3d13dd09c8f884b1bbf89397bc207e22ef7a4ad477b3818607bddee70f57d115fae36354770e30b4e8a43280ad3c3d972a9a000de8b9ec2
@@ -1,3 +1,2 @@
1
1
  ---
2
- git: true
3
2
  rubygems: true
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## Unreleased
2
2
  [no unreleased changes yet]
3
3
 
4
+ ## v4.1.0 (2025-03-20)
5
+ - Support optional tag prefix (via a `tag_prefix` in `.release_assistant.yml`).
6
+
7
+ ## v4.0.0 (2025-03-20)
8
+ - **BREAKING:** Always push to git, rather than requiring `git: true` to be specified in the config (or respecting at all a `git` option in the config).
9
+
4
10
  ## v3.2.0 (2025-03-20)
5
11
  - Add `-a` flag to `git tag` command to be clear that the tag is annotated.
6
12
 
@@ -11,7 +17,7 @@
11
17
  - Actually push to git even if RubyGems is also enabled.
12
18
 
13
19
  ## v3.0.0 (2025-03-20)
14
- - Stop creating a new alpha version after release.
20
+ - **BREAKING:** Stop creating a new alpha version after release.
15
21
  - Push to git even if pushing to RubyGems is not enabled.
16
22
 
17
23
  ## v2.0.1 (2025-03-19)
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- runger_release_assistant (3.2.0)
12
+ runger_release_assistant (4.1.0)
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 (3.2.0)
193
+ runger_release_assistant (4.1.0)
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
@@ -112,7 +112,6 @@ Here is an example:
112
112
 
113
113
  ```yml
114
114
  ---
115
- git: true
116
115
  rubygems: false
117
116
  primary_branch: main
118
117
  ```
@@ -120,11 +119,7 @@ primary_branch: main
120
119
  The above example (more or less) illustrates the default values, so you don't
121
120
  need to create a config file, if those are the values that you want.
122
121
 
123
- Regarding the `primary_branch` option, `runger_release_assistant` will
124
- automatically detect as the "primary branch" any one of the following: `main`,
125
- `master`, or `trunk`. So, if one of those is the name of your primary branch,
126
- and if you also want `git: true` and `rubygems: false`, then you don't need to
127
- create a config file.
122
+ Regarding the `primary_branch` option, `runger_release_assistant` will automatically detect as the "primary branch" any one of the following: `main`, `master`, or `trunk`. So, if one of those is the name of your primary branch, and if you also want `rubygems: false`, then you don't need to create a config file.
128
123
 
129
124
  ## Post-release command
130
125
 
@@ -137,6 +132,16 @@ you'd also like to release the gem via RubyGems, then create a `.release_assista
137
132
  executing `release --init`. Within that file, modify the default `rubygems: false` option to
138
133
  `rubygems: true`.
139
134
 
135
+ ## Tag prefix
136
+
137
+ By default, Git tags are created like `v1.0.0`. If you would like to prefix the git tag with any additional content, you may specify a `tag_prefix` in `.release_assistant.yml`, such as:
138
+
139
+ ```yml
140
+ tag_prefix: gem/
141
+ ```
142
+
143
+ This example would generate tags in the form `gem/v1.0.0`.
144
+
140
145
  ## Development
141
146
 
142
147
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run
@@ -2,6 +2,6 @@
2
2
 
3
3
  # rubocop:disable Style/StaticClass
4
4
  class RungerReleaseAssistant
5
- VERSION = '3.2.0'
5
+ VERSION = '4.1.0'
6
6
  end
7
7
  # rubocop:enable Style/StaticClass
@@ -43,7 +43,7 @@ class RungerReleaseAssistant
43
43
  end
44
44
  end
45
45
 
46
- DEFAULT_OPTIONS = { git: true, rubygems: false }.freeze
46
+ DEFAULT_OPTIONS = { rubygems: false }.freeze
47
47
 
48
48
  class << self
49
49
  def define_slop_options(options)
@@ -53,9 +53,8 @@ class RungerReleaseAssistant
53
53
  end
54
54
  end
55
55
 
56
- def initialize(options)
56
+ def initialize(options = {}) # rubocop:disable Style/OptionHash
57
57
  @options = options
58
- validate_options!
59
58
  logger.debug("Running release with options #{@options}")
60
59
  end
61
60
 
@@ -95,12 +94,6 @@ class RungerReleaseAssistant
95
94
 
96
95
  private
97
96
 
98
- def validate_options!
99
- if @options[:git] != true
100
- fail('The `git` configuration option must be `true`')
101
- end
102
- end
103
-
104
97
  def ensure_on_main_branch
105
98
  if current_branch != primary_branch
106
99
  fail('You must be on the primary branch to release!')
@@ -187,11 +180,11 @@ class RungerReleaseAssistant
187
180
  end
188
181
 
189
182
  def create_tag
190
- execute_command(%(git tag -a '#{git_tag_version(next_version)}' -m 'Version #{next_version}'))
183
+ execute_command(%(git tag -a '#{git_tag(next_version)}' -m 'Version #{next_version}'))
191
184
  end
192
185
 
193
- def git_tag_version(version)
194
- "v#{version}"
186
+ def git_tag(version)
187
+ "#{@options[:tag_prefix]}v#{version}"
195
188
  end
196
189
 
197
190
  def push_to_rubygems_and_or_git
@@ -199,15 +192,7 @@ class RungerReleaseAssistant
199
192
  push_to_rubygems
200
193
  end
201
194
 
202
- if @options[:git]
203
- push_to_git
204
- end
205
- end
206
-
207
- def push_to_git
208
- logger.debug('Pushing to git remote')
209
- execute_command('git push')
210
- execute_command('git push --tags')
195
+ push_to_git
211
196
  end
212
197
 
213
198
  def push_to_rubygems
@@ -216,6 +201,12 @@ class RungerReleaseAssistant
216
201
  execute_command('bundle exec rake release', show_system_output: true)
217
202
  end
218
203
 
204
+ def push_to_git
205
+ logger.debug('Pushing to git remote')
206
+ execute_command('git push')
207
+ execute_command('git push --tags')
208
+ end
209
+
219
210
  def run_post_release_command
220
211
  post_release_command_query_command =
221
212
  'runger-config --directory ~/code/dotfiles post-release-command'
@@ -284,7 +275,7 @@ class RungerReleaseAssistant
284
275
  { 'DELTA_PAGER' => 'cat' },
285
276
  'git',
286
277
  'diff',
287
- "#{git_tag_version(current_released_version)}...",
278
+ "#{latest_tag}...",
288
279
  )
289
280
  end
290
281
 
@@ -310,9 +301,14 @@ class RungerReleaseAssistant
310
301
  file_path('CHANGELOG.md')
311
302
  end
312
303
 
304
+ memo_wise \
305
+ def latest_tag
306
+ `git tag -l 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -1`.rstrip
307
+ end
308
+
313
309
  memo_wise \
314
310
  def current_released_version
315
- `git tag -l 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -1`.delete_prefix('v').rstrip
311
+ latest_tag.match(/v(\d.*)$/)&.[](1)
316
312
  end
317
313
 
318
314
  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: 3.2.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger