Skip to content

Commit

Permalink
chores: Rewrite release task
Browse files Browse the repository at this point in the history
  • Loading branch information
yhara committed Jun 2, 2019
1 parent ab28682 commit 7a43518
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 41 deletions.
9 changes: 9 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@

1. `bundle update`
2. `rake build_min -B`

# How to make a release

1. Test
- rackup and open http://localhost:9292/
- Open starter-kit/index.html in Firefox
1. Edit opal/dxopal/version.rb
1. Add release date in CHANGELOG.md
1. `rake release`
64 changes: 23 additions & 41 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,29 @@ task :api do
sh "yard doc -o doc/api/ opal/**/*.rb"
end

namespace "release" do
desc "Make a release commit"
task :make_release_commit do
sh "rake api"
sh "rake build_min -B"
sh "gem build dxopal.gemspec"
sh "git ci -a -m 'v#{DXOpal::VERSION}'"
end

desc "Make a tag and push to github"
task :push_tag do
sh "git tag 'v#{DXOpal::VERSION}'"
sh "git push origin master --tags"
end

desc "Release gem"
task :push_gem do
sh "gem push dxopal-#{DXOpal::VERSION}.gem"
end

desc "Release starter kit"
task :release_kit do
cd "starter-kit" do
sh "git status"
print "ok? [y/n] "
if $stdin.gets.chomp == "y"
sh "git ci dxopal.min.js -m 'v#{DXOpal::VERSION}'"
sh "git tag 'v#{DXOpal::VERSION}'"
sh "git push origin master --tags"
end
desc "git ci, git tag and git push"
task :release do
sh "git diff HEAD"
v = "v#{DXOpal::VERSION}"
puts "release as #{v}? [y/N]"
break unless $stdin.gets.chomp == "y"

sh "rake api"
sh "rake build_min -B"
sh "gem build dxopal.gemspec"

sh "git ci -am '#{v}'"
sh "git tag '#{v}'"
sh "git push origin master --tags"
sh "gem push dxopal-#{DXOpal::VERSION}.gem"

cd "starter-kit" do
sh "git status"
print "ok? [y/n] "
if $stdin.gets.chomp == "y"
sh "git ci dxopal.min.js -m 'v#{DXOpal::VERSION}'"
sh "git tag 'v#{DXOpal::VERSION}'"
sh "git push origin master --tags"
end
end
end

# How to make a release
# 0. Edit opal/dxopal/version.rb
# 1. Add release date in CHANGELOG.md
# 2. `rake release:make_release_commit`
# 3. Test
# - Open starter-kit/index.html in Firefox
# - rackup and open http://localhost:9292/
# 4. `rake release:push_tag`
# 5. `rake release:push_gem`
# 6. `rake release:release_kit`

0 comments on commit 7a43518

Please sign in to comment.