Skip to content

Commit

Permalink
Verify the presence of the private key before releasing. (#4899)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emily Giurleo authored Oct 13, 2020
1 parent 1661006 commit 6095443
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require "bundler"
require "bundler/gem_tasks"
Bundler.setup

require "rake"
Expand All @@ -9,6 +10,9 @@ require "rspec/core/rake_task"
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "mongoid/version"

tasks = Rake.application.instance_variable_get('@tasks')
tasks['release:do'] = tasks.delete('release')

task :gem => :build
task :build do
system "gem build mongoid.gemspec"
Expand Down Expand Up @@ -54,3 +58,13 @@ namespace :docs do
system "yardoc -o #{out} --title mongoid-#{Mongoid::VERSION}"
end
end

namespace :release do
task :check_private_key do
unless File.exist?('gem-private_key.pem')
raise "No private key present, cannot release"
end
end
end

task :release => ['release:check_private_key', 'release:do']

0 comments on commit 6095443

Please sign in to comment.