-
Notifications
You must be signed in to change notification settings - Fork 15
/
Rakefile
35 lines (26 loc) · 802 Bytes
/
Rakefile
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
task default: :spec
task :spec do
sh "rspec"
end
task release: %i[clean spec git gem] do
otp = `op item get RubyGems.org --otp`.chomp
ENV["GEM_HOST_OTP_CODE"] = otp unless otp.empty?
sh "gem push *.gem"
sh "git tag v%s" % [Faraday::RestrictIPAddresses::VERSION]
sh "git push --tags"
end
task gem: %i[clean git] do
version = ENV["VERSION"] || ENV["V"]
abort "Specify VERSION=x.y.z to release" unless version
require_relative "lib/faraday/restrict_ip_addresses/version"
act = Faraday::RestrictIPAddresses::VERSION
abort "Version specified doesn't match %p" % [act] unless act == version
sh "gem build"
end
task :git do
status = `git status --porcelain`
abort "git looks dirty\n#{status}" unless status.lines.empty?
end
task :clean do
rm_f Dir["**/*~", "*.gem"]
end