소스 검색

use release script to avoid mess ups...

Evan You 9 년 전
부모
커밋
f88232b964
2개의 변경된 파일27개의 추가작업 그리고 2개의 파일을 삭제
  1. 26 0
      build/release.sh
  2. 1 2
      package.json

+ 26 - 0
build/release.sh

@@ -0,0 +1,26 @@
+set -e
+echo "Enter release version: "
+read VERSION
+
+read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
+echo    # (optional) move to a new line
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+    echo "Releasing $VERSION ..."
+
+    # run tests
+    npm test 2>/dev/null
+
+    # build
+    VERSION=$VERSION npm run build
+
+    # # commit
+    git add -A
+    git commit -m "[build] $VERSION"
+    npm version $VERSION --message "[release] $VERSION"
+
+    # # publish
+    git push origin refs/tags/v$VERSION
+    git push
+    npm publish
+fi

+ 1 - 2
package.json

@@ -20,8 +20,7 @@
     "e2e": "casperjs test --concise ./test/e2e",
     "e2e": "casperjs test --concise ./test/e2e",
     "test": "eslint src && npm run unit && npm run build-examples && npm run e2e",
     "test": "eslint src && npm run unit && npm run build-examples && npm run e2e",
     "docs": "cd docs && gitbook serve",
     "docs": "cd docs && gitbook serve",
-    "deploy-docs": "cd docs && ./deploy.sh",
-    "prepublish": "npm run build"
+    "deploy-docs": "cd docs && ./deploy.sh"
   },
   },
   "repository": {
   "repository": {
     "type": "git",
     "type": "git",