forked from qltysh/qlty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprep-release
executable file
·45 lines (35 loc) · 927 Bytes
/
prep-release
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
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
#
# Open a PR for releasing a new version of this repository.
#
# Usage: bin/prep-release VERSION
#
###
set -e
if [ -z "$1" ]; then
echo "usage: bin/prep-release VERSION" >&2
exit 64
fi
./bin/validate-release
version="$1"
old_version=$(< VERSION)
branch="release-$version"
printf "RELEASE %s => %s\n" "$old_version" "$version"
git fetch origin master
git reset --hard origin/master
git checkout -b "$branch"
printf "%s\n" "$version" > VERSION
make image bundle
git add VERSION Gemfile.lock
git commit --message "Release v$version"
git push origin "$branch"
branch_head=$(git rev-parse --short "$branch")
if command -v hub > /dev/null 2>&1; then
hub pull-request -F - <<EOF
Release v$version
https://github.com/codeclimate/codeclimate/compare/v$old_version...$branch_head
EOF
else
echo "hub not installed? Please open the PR manually" >&2
fi
echo "After merging the version-bump PR, run bin/release"