1 | #!/bin/sh
|
2 |
|
3 | if [ -z "`which github-changes`" ]; then
|
4 |
|
5 |
|
6 | echo "First, do: [sudo] npm install -g github-changes@0.0.14"
|
7 | exit 1
|
8 | fi
|
9 |
|
10 | if [ -d .git/refs/remotes/upstream ]; then
|
11 | remote=upstream
|
12 | else
|
13 | remote=origin
|
14 | fi
|
15 |
|
16 |
|
17 | npm version minor || exit 1
|
18 |
|
19 |
|
20 | github-changes -o request -r request \
|
21 | --auth --verbose \
|
22 | --file CHANGELOG.md \
|
23 | --only-pulls --use-commit-body \
|
24 | --date-format '(YYYY/MM/DD)' \
|
25 | || exit 1
|
26 |
|
27 |
|
28 |
|
29 | version="$(grep '"version"' package.json | cut -d'"' -f4)"
|
30 | sed -i -e "s/^### upcoming/### v$version/" CHANGELOG.md
|
31 |
|
32 |
|
33 |
|
34 | git add CHANGELOG.md; git commit -m 'Update changelog'
|
35 |
|
36 |
|
37 | npm publish || exit 1
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | npm version patch || exit 1
|
43 |
|
44 |
|
45 | git push $remote master --tags || exit 1
|