-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrelease.sh
executable file
·36 lines (33 loc) · 990 Bytes
/
release.sh
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
#!/bin/bash
set -e
current_dir=$(pwd)
cd $(dirname $0)
old_version=$(git tag | tail -n1)
version=$1
npm test
update_version() { sed -i '' -E "s/(\"version\".*:.*\").*(\".*)/\1$version\2/g" $@; }
update_version src/index.js
npm install
#npm release
#TODO create js documentation
#/usr/local/share/npm/lib/node_modules/doxx/bin/doxx --source ./src/main --target ./docs
if [ "$version" = "" ]
then
echo "Version information not found. Type ./release.sh <version>"
echo "Previous version was $old_version"
else
echo "Creating version $version"
update_version package.json
echo -e "h3. $version \n\n$PLEASE EDIT:\n$(git log --pretty=format:%s $old_version^..)\n\n$(cat History.textile)" > History.textile
vim History.textile
git add -A .
git commit -m "Build for version $version"
git tag $version
git status
echo "Now type:"
echo "git push "
echo "git push --tags"
echo "npm publish"
echo "git co gh-pages && git merge master && git push && git co master"
fi
cd $current_dir