reissue 0.4.10 → 0.4.12

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: 6f62c8ac05132854096bc7ad4cf5b2350a7b53ca183bc8c1090beca3297f3877
4
- data.tar.gz: 18deca778dae79bca2b168c4ec759b601f1cd762f58b4e2e7b66d9b7ad9fe984
3
+ metadata.gz: cf56ad0901ffde10b776b0529140063ae09bc092f6325130308e2df0be4b7168
4
+ data.tar.gz: 50ae2fee9430aa29e1624aab368e98f96953abc7b49cfd6662b619c155d38c24
5
5
  SHA512:
6
- metadata.gz: 63e8a825e67c084a31560d7c09006fad20cd4387fc8ea220279e7fc4df8697ca6c4118eb1a9233cf650fe4e28c41588dad9af60384f34d9f4e4500fde9a1f791
7
- data.tar.gz: 67a8cd01e0a65e6581d6932f1bfb686e02fe131390a4aa11fa4b625345fefb075576cd7c8e4ecc7f3f55da08f4fc8f60402eb122ec84d0010be5ee864c931846
6
+ metadata.gz: 397b4f6d6f09afad74c5fc429fcf05da8c12d3fce2f21345911fc2d7d4ef2b6ca8a0ecd64d7d0bc7b753e09171e86e7cb156fe1e73ee5282c78298f6993fd57e
7
+ data.tar.gz: 59b5f79e5a50d4481f1a507c2aed416714237b6cf03ec0db823e85b7d82af0c39e7372a60d51747df2d6e61f57bfff9696e1065a1adef7fc21f683ae5dce23e9
data/CHANGELOG.md CHANGED
@@ -5,10 +5,27 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
- ## [0.4.10] - 2026-01-27
8
+ ## [0.4.12] - 2026-02-09
9
9
 
10
- ## [0.4.9] - 2026-01-15
10
+ ### Changed
11
+
12
+ - reissue:bump now reads Version trailers regardless of whether the version file matches the last tag (98905d6)
13
+
14
+ ## [0.4.11] - 2026-02-06
15
+
16
+ ### Added
17
+
18
+ - reissue:initialize task to create changelog and show setup instructions (ad4ae54)
19
+ - working_directory input for monorepo gem releases (55dea65)
20
+ - Gem integration tests for checksums in updated_paths (16b801e)
21
+
22
+ ### Changed
23
+
24
+ - Replace rubygems/release-gem action with explicit release steps (55dea65)
11
25
 
12
26
  ### Fixed
13
27
 
14
- - Adding delete of remote branch after deling the local branch during the reissue:branch task to help with stale tracking reference. (3f6e1fb)
28
+ - Finalize task fails when changelog is already committed (307939e)
29
+ - Checksums not staged during finalize task (307939e)
30
+ - Stage updated_paths fails when files do not exist (16b801e)
31
+ - Release workflow fails with working-directory command not found (9068f04)
data/lib/reissue/rake.rb CHANGED
@@ -169,6 +169,20 @@ module Reissue
169
169
  end
170
170
  end
171
171
 
172
+ # Check if there are staged changes ready to commit.
173
+ def changes_to_commit?
174
+ _, _, status = Open3.capture3("git diff --cached --quiet")
175
+ !status.success?
176
+ end
177
+
178
+ # Stage updated_paths that exist on disk.
179
+ def stage_updated_paths
180
+ existing = updated_paths.select { |p| File.exist?(p) }
181
+ if existing.any?
182
+ run_command("git add #{existing.join(" ")}", "Failed to stage additional paths: #{existing.join(", ")}")
183
+ end
184
+ end
185
+
172
186
  def define
173
187
  desc description
174
188
  task name, [:segment] do |task, args|
@@ -186,13 +200,12 @@ module Reissue
186
200
  tasker["#{name}:clear_fragments"].invoke
187
201
 
188
202
  run_command("git add -u", "Failed to stage updated files")
189
- if updated_paths&.any?
190
- run_command("git add #{updated_paths.join(" ")}", "Failed to stage additional paths: #{updated_paths.join(", ")}")
191
- end
203
+ stage_updated_paths
192
204
 
193
205
  bump_message = "Bump version to #{new_version}"
194
206
  if commit
195
207
  if reissue_version_with_branch?
208
+ tasker["#{name}:branch"].reenable
196
209
  tasker["#{name}:branch"].invoke("reissue/#{new_version}")
197
210
  end
198
211
  run_command("git commit -m '#{bump_message}'", "Failed to commit version bump")
@@ -233,8 +246,13 @@ module Reissue
233
246
  tasker["#{name}:branch"].invoke("finalize/#{version}")
234
247
  end
235
248
  run_command("git add -u", "Failed to stage finalized changelog")
236
- run_command("git commit -m '#{finalize_message}'", "Failed to commit finalized changelog")
237
- tasker["#{name}:push"].invoke if push_finalize?
249
+ stage_updated_paths
250
+ if changes_to_commit?
251
+ run_command("git commit -m '#{finalize_message}'", "Failed to commit finalized changelog")
252
+ tasker["#{name}:push"].invoke if push_finalize?
253
+ else
254
+ puts finalize_message
255
+ end
238
256
  else
239
257
  puts finalize_message
240
258
  end
@@ -348,28 +366,106 @@ module Reissue
348
366
  # Get version from last git tag
349
367
  tag_version = handler.last_tag_version
350
368
 
351
- # Only bump if current version matches tag version (hasn't been bumped yet)
352
- if tag_version && current_version == tag_version
353
- bump = handler.read_version_bump
369
+ bump = handler.read_version_bump
354
370
 
371
+ if tag_version && current_version == tag_version
355
372
  if bump
356
373
  updater = Reissue::VersionUpdater.new(version_file, version_redo_proc: version_redo_proc)
357
374
  updater.call(bump)
358
375
  puts "Version bumped (#{bump}) to #{updater.instance_variable_get(:@new_version)}"
359
376
  end
360
377
  elsif tag_version && current_version != tag_version
361
- puts "Version already bumped (#{tag_version} → #{current_version}), skipping"
362
- else
363
- # No tag exists, check for version trailers anyway
364
- bump = handler.read_version_bump
365
-
366
378
  if bump
367
379
  updater = Reissue::VersionUpdater.new(version_file, version_redo_proc: version_redo_proc)
368
- updater.call(bump)
369
- puts "Version bumped (#{bump}) to #{updater.instance_variable_get(:@new_version)}"
380
+ desired_version = updater.redo(tag_version, bump)
381
+
382
+ if desired_version > current_version
383
+ updater.call(bump)
384
+ puts "Version bumped (#{bump}) to #{updater.instance_variable_get(:@new_version)}"
385
+ else
386
+ puts "Version already bumped (#{tag_version} → #{current_version}), skipping"
387
+ end
388
+ else
389
+ puts "Version already bumped (#{tag_version} → #{current_version}), skipping"
370
390
  end
391
+ elsif bump
392
+ updater = Reissue::VersionUpdater.new(version_file, version_redo_proc: version_redo_proc)
393
+ updater.call(bump)
394
+ puts "Version bumped (#{bump}) to #{updater.instance_variable_get(:@new_version)}"
371
395
  end
372
396
  end
373
397
  end
374
398
  end
375
399
  end
400
+
401
+ # Define the reissue:initialize task as a standalone task
402
+ # This works without any configuration, allowing users to bootstrap their project
403
+ namespace :reissue do
404
+ desc "Initialize reissue by creating a CHANGELOG.md and showing Rakefile configuration"
405
+ task :initialize do
406
+ changelog_file = "CHANGELOG.md"
407
+
408
+ if File.exist?(changelog_file)
409
+ puts "✓ #{changelog_file} already exists"
410
+ else
411
+ Reissue.generate_changelog(changelog_file)
412
+ puts "✓ Created #{changelog_file}"
413
+ end
414
+
415
+ puts
416
+ puts "Add the following to your Rakefile to enable reissue tasks:"
417
+ puts
418
+ puts <<~RAKEFILE
419
+ require "reissue/rake"
420
+
421
+ Reissue::Task.create :reissue do |task|
422
+ task.version_file = "lib/your_gem/version.rb" # Required: path to your VERSION constant
423
+ end
424
+ RAKEFILE
425
+
426
+ puts
427
+ puts "Optional configuration:"
428
+ puts
429
+ puts <<~OPTIONS
430
+ Reissue::Task.create :reissue do |task|
431
+ task.version_file = "lib/your_gem/version.rb"
432
+
433
+ # Changelog options
434
+ task.changelog_file = "CHANGELOG.md" # Default: "CHANGELOG.md"
435
+ task.version_limit = 2 # Versions to keep in changelog
436
+
437
+ # Fragment handling for changelog entries
438
+ task.fragment = :git # Use git commit trailers (Added:, Fixed:, etc.)
439
+ # task.fragment = "changelog_fragments" # Or use a directory of fragment files
440
+ task.clear_fragments = false # Clear fragment files after release. Not necessary when using git trailers.
441
+
442
+ # Git workflow options
443
+ task.commit = true # Auto-commit version bumps
444
+ task.commit_finalize = true # Auto-commit changelog finalization
445
+ task.push_reissue = :branch # Push strategy: false, true, or :branch
446
+ task.push_finalize = false # Push after finalize: false, true, or :branch
447
+
448
+ # Custom tag pattern for version detection (must include capture group)
449
+ # task.tag_pattern = /^myapp-v(\\d+\\.\\d+\\.\\d+.*)$/
450
+ end
451
+ OPTIONS
452
+
453
+ puts
454
+ puts "For Ruby gems, use reissue/gem for automatic integration with bundler tasks:"
455
+ puts
456
+ puts <<~GEM_USAGE
457
+ require "reissue/gem"
458
+
459
+ Reissue::Task.create :reissue do |task|
460
+ task.version_file = "lib/your_gem/version.rb"
461
+ task.fragment = :git
462
+ end
463
+ GEM_USAGE
464
+
465
+ puts
466
+ puts "This automatically runs reissue:bump and reissue:finalize before `rake build`"
467
+ puts "and runs reissue after `rake release`."
468
+ puts
469
+ puts "Run `rake -T reissue` to see all available tasks after configuration."
470
+ end
471
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reissue
4
- VERSION = "0.4.10"
4
+ VERSION = "0.4.12"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reissue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay