-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
49 lines (40 loc) · 1.27 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
lib = File.expand_path("../lib", __FILE__)
$:.unshift lib unless $:.include?(lib)
require "rake"
require "rubygems"
require "tmpdir"
require "pusher-chameleon/version"
GITHUB_REPONAME = "pusher/chameleon"
CHAMELEON_VERSION = PusherChameleon::VERSION
namespace :chameleon do
desc "Publish to NPM"
task :npm_publish do
system "npm publish"
end
# If this fails, then you probably need to login first
desc "Publish to RubyGems"
task :gem_publish do
system "gem build pusher-chameleon.gemspec"
system "gem push pusher-chameleon-#{CHAMELEON_VERSION}.gem"
end
desc "Generate docs files"
task :generate_docs do
Dir.chdir "docs"
system "jekyll build --config _config.yml,_config.production.yml"
end
desc "Generate and publish docs to gh-pages"
task :publish => [:gem_publish, :npm_publish, :generate_docs] do
Dir.mktmpdir do |tmp|
cp_r "_site/.", tmp
pwd = Dir.pwd
message = "Docs version #{CHAMELEON_VERSION} - Released at #{Time.now.utc}"
Dir.chdir tmp
system "git init"
system "git add ."
system "git commit -m #{message.inspect}"
system "git remote add origin git@github.com:#{GITHUB_REPONAME}.git"
system "git push origin master:refs/heads/gh-pages --force"
Dir.chdir pwd
end
end
end