forked from raimohanska/harmaja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
38 lines (28 loc) · 750 Bytes
/
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
#!/usr/bin/env bash -e
version=$1
if [ -z $version ]; then
currentversion=`scripts/version`
echo "Enter release version (current is $currentversion):"
read version
fi
export DIST_VERSION=$version
files="package.json"
echo "Releasing with version $version"
echo "1. Pulling from origin"
git pull --ff-only --no-rebase origin
echo "2. Building and testing"
yarn install
yarn test
echo "3. Setting version info to descriptor files"
sed -i "" 's/\("version".*:.*\)".*"/\1"'$version'"/' $files
exit 0
echo "4. Commit and tag"
git add .
git commit -m "release $version"
git tag $version
echo "5. Push to origin/master"
git push
git push --tags origin
echo "6. Publish to npm --tag latest"
npm publish
echo "DONE! Released version $version"