Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a release file list check
  • Loading branch information
deivid-rodriguez committed Mar 5, 2019
1 parent 9677d2e commit 0bf5104
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion task/release.rake
Expand Up @@ -4,9 +4,33 @@ require "bundler/gem_tasks"
task :build => ["build_metadata", "man:build", "generate_files"] do
Rake::Task["build_metadata:clean"].tap(&:reenable).real_invoke
end
task :release => ["man:require", "man:build", "release:verify_github", "build_metadata"]
task :release => ["man:require", "man:build", "release:verify_files", "release:verify_github", "build_metadata"]

namespace :release do
task :verify_files do
git_list = IO.popen("git ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
git_list += %w[CHANGELOG.md LICENSE.md README.md bundler.gemspec]
git_list += Dir.glob("man/**/*")

gem_list = Gem::Specification.load("bundler.gemspec").files

extra_files = gem_list.to_set - git_list.to_set

error_msg = <<~MSG
You intend to ship some files with the gem that are not generated man pages
nor source control files. Please review the extra list of files and try
again:
#{extra_files.to_a.join("\n ")}
MSG

raise error_msg if extra_files.any?

puts "The file list is correct for a release."
end

def gh_api_post(opts)
gem "netrc", "~> 0.11.0"
require "netrc"
Expand Down

0 comments on commit 0bf5104

Please sign in to comment.