-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
39 lines (30 loc) · 859 Bytes
/
Copy pathRakefile
File metadata and controls
39 lines (30 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true
require 'rake'
require 'rubygems/package'
require 'bundler'
require 'bundler/gem_tasks'
require_relative 'lib/blog-tools/version'
GEM_NAME = 'blog-tools'
VERSION = BlogTools::VERSION
TAG = "v#{VERSION}".freeze
desc 'Tag, push to GitHub, build and push to RubyGems'
task :release do
sh 'git add .'
sh "git commit -m 'Release #{TAG}'" unless `git status --porcelain`.strip.empty?
puts "Tagging #{TAG}..."
sh "git tag #{TAG}"
sh 'git push origin main'
sh "git push origin #{TAG}"
puts 'Building gem...'
sh "gem build #{GEM_NAME}.gemspec"
puts 'Pushing gem to RubyGems...'
gem_file = "#{GEM_NAME}-#{VERSION}.gem"
sh "gem push #{gem_file}"
end
desc 'Run RSpec and Rubocop tests'
task :check do
puts 'Running RSpec tests...'
sh 'rspec --format d'
puts 'Running RuboCop...'
sh 'rubocop'
end