-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathgithub.rake
34 lines (25 loc) · 993 Bytes
/
github.rake
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
task 'github:require-access-token' do
unless ENV['AWS_SDK_FOR_RUBY_GH_TOKEN']
warn("export ENV['AWS_SDK_FOR_RUBY_GH_TOKEN']")
exit
end
end
task 'github:release' do
require 'octokit'
gh = Octokit::Client.new(:access_token => ENV['AWS_SDK_FOR_RUBY_GH_TOKEN'])
repo = 'aws/aws-sdk-ruby'
tag_ref_sha = `git show-ref v#{$VERSION}`.split(' ').first
tag = gh.tag(repo, tag_ref_sha)
release = gh.create_release(repo, "v#{$VERSION}", {
:name => 'Release v' + $VERSION + ' - ' + tag.tagger.date.strftime('%Y-%m-%d'),
:body => tag.message.lines[2..-1].join,
:prerelease => $VERSION.match('rc') ? true : false,
})
gh.upload_asset(release.url, 'api-docs.zip',
:content_type => 'application/octet-stream')
gh.upload_asset(release.url, "aws-sdk-#{$VERSION}.gem",
:content_type => 'application/octet-stream')
gh.upload_asset(release.url, "aws-sdk-v1-#{$VERSION}.gem",
:content_type => 'application/octet-stream')
end
task 'github:access_token'