-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathrelease.sh
More file actions
24 lines (16 loc) · 737 Bytes
/
release.sh
File metadata and controls
24 lines (16 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -e
echo "Does package.json has the NEXT package version which you want to publish? Rest of the index must be clean"
read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
# inline replace the version number on the first line only
sed -i "" "1 s/v.*/v$PACKAGE_VERSION/" scss/_main.scss
# rebuild css files with new version number
npm install
npm run scss
git add scss
git add css
git add package.json
git commit -m "Release v$PACKAGE_VERSION"
git tag -a "$PACKAGE_VERSION" -m "Release $PACKAGE_VERSION" && git push --tags
npm publish