Skip to content

Commit 2b8d549

Browse files
committed
adjusting release script to support patch versions
1 parent f336730 commit 2b8d549

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

script/release

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ GH_OWNER = ENV['GH_OWNER'] || 'github'
3232
GH_AUTHOR = ENV['GH_AUTHOR']
3333
DEB_PKG_NAME = 'github-backup-utils'
3434
GH_BASE_BRANCH = ENV['GH_BASE_BRANCH'] || 'master'
35+
GH_STABLE_BRANCH = ENV['GH_STABLE_BRANCH'] || 'stable'
3536

3637
CHANGELOG_TMPL = '''<%= package_name %> (<%= package_version %>) UNRELEASED; urgency=medium
3738
@@ -137,7 +138,7 @@ def beautify_changes(changes)
137138
end
138139

139140
def changelog
140-
changes = `git log --pretty=oneline origin/stable...origin/#{GH_BASE_BRANCH} --reverse --grep "Merge pull request" | sort -t\# -k2`.lines.map(&:strip)
141+
changes = `git log --pretty=oneline origin/#{GH_STABLE_BRANCH}...origin/#{GH_BASE_BRANCH} --reverse --grep "Merge pull request" | sort -t\# -k2`.lines.map(&:strip)
141142
raise 'Building the changelog failed' if $CHILD_STATUS != 0
142143

143144
changes
@@ -228,12 +229,12 @@ def push_release_branch(version)
228229
end
229230

230231
def update_stable_branch
231-
`git checkout --quiet stable`
232+
`git checkout --quiet #{GH_STABLE_BRANCH}`
232233
unless (out = `git merge --quiet --ff-only origin/#{GH_BASE_BRANCH}`)
233-
warn "Merging #{GH_BASE_BRANCH} into stable failed:\n\n#{out}"
234+
warn "Merging #{GH_BASE_BRANCH} into #{GH_STABLE_BRANCH} failed:\n\n#{out}"
234235
end
235-
unless (out = `git push --quiet origin stable`)
236-
warn "Failed pushing the stable branch:\n\n#{out}"
236+
unless (out = `git push --quiet origin #{GH_STABLE_BRANCH}`)
237+
warn "Failed pushing the #{GH_STABLE_BRANCH} branch:\n\n#{out}"
237238
end
238239
end
239240

0 commit comments

Comments
 (0)