Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/tasks/release.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ desc("Releases the gem using the given version.

IMPORTANT: the gem version must be in valid rubygem format (no dashes).

This task depends on the gem-release ruby gem which is installed via `bundle install`
This task depends on the gem-release ruby gem. Install it globally with:
gem install gem-release

1st argument: The new version in rubygem format (no dashes). Pass no argument to
automatically perform a patch version bump.
Expand All @@ -21,6 +22,11 @@ task :release, %i[gem_version dry_run] do |_t, args|
File.expand_path('..', __dir__)
end

# Check if gem-release is installed
unless system("gem list -i gem-release > /dev/null 2>&1")
raise "gem-release is not installed. Please run: gem install gem-release"
end

# Check if there are uncommitted changes
unless `git status --porcelain`.strip.empty?
raise "You have uncommitted changes. Please commit or stash them before releasing."
Expand Down