EC-21: FEAT: Added better tools for auto build & publishing
Refers: Evercatch/evercatch-board#21
This commit is contained in:
39
Rakefile
Normal file
39
Rakefile
Normal file
@@ -0,0 +1,39 @@
|
||||
# Rakefile for building and publishing the evercatch gem
|
||||
|
||||
# --- Configuration ---
|
||||
GITEA_HOST = "https://git.psmattas.com/api/packages/Evercatch/rubygems"
|
||||
GEMSPEC_FILE = "evercatch.gemspec"
|
||||
# --------------------
|
||||
|
||||
# Load gemspec to get name and version
|
||||
spec = Gem::Specification.load(GEMSPEC_FILE)
|
||||
PACKAGE_FILE = "#{spec.name}-#{spec.version}.gem"
|
||||
|
||||
desc "Build the #{PACKAGE_FILE} gem"
|
||||
task :build do
|
||||
puts "Building #{PACKAGE_FILE}..."
|
||||
system("gem build #{GEMSPEC_FILE}")
|
||||
end
|
||||
|
||||
namespace :publish do
|
||||
desc "Publish the gem to the public RubyGems.org registry"
|
||||
task :public => :build do
|
||||
puts "Publishing #{PACKAGE_FILE} to RubyGems.org..."
|
||||
system("gem push #{PACKAGE_FILE}")
|
||||
end
|
||||
|
||||
desc "Publish the gem to the private Gitea registry"
|
||||
task :gitea => :build do
|
||||
puts "Publishing #{PACKAGE_FILE} to Gitea..."
|
||||
system("gem push --host #{GITEA_HOST} #{PACKAGE_FILE}")
|
||||
end
|
||||
|
||||
desc "Publish the gem to both Gitea and RubyGems.org"
|
||||
task :all => [:gitea, :public]
|
||||
end
|
||||
|
||||
desc "Clean up built package files"
|
||||
task :clean do
|
||||
puts "Cleaning up *.gem files..."
|
||||
system("rm -f *.gem")
|
||||
end
|
||||
Reference in New Issue
Block a user