diff --git a/Rakefile b/Rakefile index d9e02c8..212c46f 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 'next #{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|