EC-21: FEAT: Added better tools for auto build & publishing

Refers: Evercatch/evercatch-board#21
This commit is contained in:
2026-02-20 11:14:42 +00:00
parent 1c6812483d
commit f31001dd51
2 changed files with 53 additions and 0 deletions

14
Gemfile Normal file
View File

@@ -0,0 +1,14 @@
# Gemfile
# Default source for all public gems
source "https://rubygems.org"
# Other project gems
gem "rails", "~> 7.0"
gem "puma", "~> 6.4"
# Specify that the 'evercatch' gem should be fetched from Gitea server.
# The user must have their ~/.gem/credentials configured.
source "https://git.psmattas.com/api/packages/Evercatch/rubygems" do
gem "evercatch", "~> 0.0.1"
end

39
Rakefile Normal file
View 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