Skip to content

Commit 6d01384

Browse files
committed
chore(build): fixes to release.sh
1 parent 109ffac commit 6d01384

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

scripts/jenkins/release.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
#!/bin/bash
22

3+
if [ -z "$1" ]; then
4+
echo "Please specify the version bump type: patch|minor|major"
5+
exit 1
6+
fi
7+
38
set -e # fail if any command fails
49
cd `dirname $0`/../..
10+
BUMP_TYPE=$1
511

612
# bump versions: remove "-snapshot" suffix
7-
sed -i -e 's/"version": "\(.*\)-snapshot"/"version": "\1"/' package.json
13+
sed -i .tmp -e 's/"version": "\(.*\)-snapshot"/"version": "\1"/' package.json
814

915
# Build
10-
./jenkins_build.sh
11-
16+
# ./jenkins_build.sh
17+
grunt package
1218
VERSION=`cat build/version.txt`
1319

14-
# bump versions: increment version number and add "-snapshot" again
20+
# Commit and tag
21+
git add package.json
22+
git commit -m "chore(release): v$VERSION"
23+
git tag -m "v$VERSION" v$VERSION
24+
25+
# bump versions: increment version number and add "-snapshot"
1526
grunt bump:$BUMP_TYPE
16-
sed -i -e 's/"version": "\(.*\)"/"version": "\1-snapshot"/' package.json
27+
NEXT_VERSION=$(node -e "console.log(require('./package.json').version)" | sed -e 's/\r//g')
28+
sed -i .tmp -e 's/"version": "\(.*\)"/"version": "\1-snapshot"/' package.json
29+
git add package.json
30+
git commit -m "chore(release): start v$NEXT_VERSION"
1731

18-
# commit, tag and push
19-
git commit -m "chore(release): v%VERSION%"
20-
git tag -m "v%VERSION%" v%VERSION%
32+
# push to github
2133
# TODO git push
2234

2335
# Update code.angularjs.org

0 commit comments

Comments
 (0)