Skip to content

Commit

Permalink
Better support master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
hmdne committed Mar 23, 2022
1 parent 81a0520 commit e5cb05f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def sh *args
system *args or raise "command failed: #{args}"
end

def cd dir, &block
Dir.chdir dir, &block
end

def git *args
sh 'git', *args
end
Expand All @@ -24,7 +28,11 @@ unless opal.join('.git').directory?
end

ENV['GIT_DIR'] = opal.join('.git').to_s
git :fetch, '--all', '--prune'
cd opal do
git :fetch, '--all', '--prune'
git :checkout, 'master'
git :reset, '--hard', 'origin/master'
end

ENV['GIT_DIR'] = nil
opal_version = root.join("tmp/#{version}")
Expand Down Expand Up @@ -64,5 +72,7 @@ system "#{__dir__}/set-current", current
git 'add', '.'
git 'commit', '-a', '-m', version
git 'push'
git 'tag', version
git 'push', '--tags'
unless version == 'master'
git 'tag', version
git 'push', '--tags'
end

0 comments on commit e5cb05f

Please sign in to comment.