1 | def version
|
2 | git_describe_tags = `git describe --tags`
|
3 | tag = git_describe_tags.split('-').first || git_describe_tags
|
4 | tag.strip!
|
5 | commit = `git rev-list --full-history #{tag}.. -- src/ | wc -l`.strip
|
6 | tag.slice! 0
|
7 | "#{tag}.#{commit}"
|
8 | end
|
9 |
|
10 | task :upload do
|
11 | require 'net/github-upload'
|
12 | gh = Net::GitHub::Upload.new(
|
13 | :login => `git config github.user`.chomp,
|
14 | :token => `git config github.token`.chomp
|
15 | )
|
16 | puts gh.upload(
|
17 | :repos => 'CSSOM',
|
18 | :file => 'build/CSSOM.js',
|
19 | :name => "CSSOM.v#{version}.js",
|
20 | :content_type => 'text/javascript',
|
21 | :description => "CSS Object Model implemented in pure JavaScript"
|
22 | )
|
23 | end
|