From 452e326bcaf89f278bf0fe80134ffb710c7e7698 Mon Sep 17 00:00:00 2001 From: Paulo Fidalgo Date: Sun, 8 Feb 2026 14:48:52 +0000 Subject: [PATCH 1/2] feat: add release:bump task for automated version management Adds rake release:bump[level] task that uses gem-release to bump version, commit, tag, and push automatically. Splits version bumping from changelog generation for better workflow separation. --- Rakefile | 21 +++++++++++++++++++++ git-markdown.gemspec | 17 +++++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index d9e02c8..0bfa731 100644 --- a/Rakefile +++ b/Rakefile @@ -16,6 +16,27 @@ end task default: %i[test standard] namespace :release do + desc "Bump version (major|minor|patch|pre) and commit" + task :bump, [:level] do |_t, args| + level = args[:level] || "patch" + valid_levels = %w[major minor patch pre] + + unless valid_levels.include?(level) + abort "Invalid level: #{level}. Use: #{valid_levels.join(", ")}" + end + + branch = `git rev-parse --abbrev-ref HEAD`.strip + unless ["main", "master"].include?(branch) + abort "Version bump must run on main or master. Current: #{branch}." + end + + unless system("git diff --quiet") && system("git diff --cached --quiet") + abort "Version bump requires a clean working tree." + end + + sh "bundle exec gem bump --version #{level} --commit --tag --push" + end + desc "Update changelog, commit, and tag" task :prep do version = GitMarkdown::VERSION diff --git a/git-markdown.gemspec b/git-markdown.gemspec index 2253be5..ab30665 100644 --- a/git-markdown.gemspec +++ b/git-markdown.gemspec @@ -7,13 +7,22 @@ Gem::Specification.new do |spec| spec.summary = "Convert GitHub PRs to Markdown for local AI code review" spec.description = "A CLI tool that fetches GitHub pull requests and converts them to Markdown format, perfect for local AI assistants like opencode and codex." - spec.homepage = "https://github.com/ethos-link/git-markdown" + spec.homepage = "https://www.ethos-link.com/opensource/git-markdown" spec.license = "MIT" spec.required_ruby_version = ">= 3.0.0" - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = spec.homepage - spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md" + repo = "https://github.com/ethos-link/git-markdown" + branch = "master" + + spec.metadata = { + "homepage_uri" => spec.homepage, + "source_code_uri" => repo, + "bug_tracker_uri" => "#{repo}/issues", + "changelog_uri" => "#{repo}/blob/#{branch}/CHANGELOG.md", + "documentation_uri" => "#{repo}/blob/#{branch}/README.md", + "funding_uri" => "https://www.reviato.com/", + "rubygems_mfa_required" => "true" + } spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject do |f| From 1540deac1e94039b77c296d4aaea4d58b8047efa Mon Sep 17 00:00:00 2001 From: Paulo Fidalgo Date: Sun, 8 Feb 2026 16:28:37 +0000 Subject: [PATCH 2/2] fix: correct gem bump command syntax in release:bump task Use 'next #{level}' format instead of just '#{level}' to properly invoke gem-release's built-in version increment logic for major, minor, patch, and pre release levels. --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 0bfa731..212c46f 100644 --- a/Rakefile +++ b/Rakefile @@ -34,7 +34,7 @@ namespace :release do abort "Version bump requires a clean working tree." end - sh "bundle exec gem bump --version #{level} --commit --tag --push" + sh "bundle exec gem bump --version 'next #{level}' --commit --tag --push" end desc "Update changelog, commit, and tag"