qingwei.li 8 жил өмнө
parent
commit
857ad3aee4
2 өөрчлөгдсөн 20 нэмэгдсэн , 11 устгасан
  1. 16 8
      build/deploy-ci.sh
  2. 4 3
      package.json

+ 16 - 8
build/deploy-ci.sh

@@ -26,15 +26,12 @@ if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
   cp -rf ../../packages/theme-default/** .
   git add -A .
   git commit -m "$TRAVIS_COMMIT_MSG"
-  if [ "$TRAVIS_TAG" ]; then
-    git tag $TRAVIS_TAG
-  fi
   git push origin master --tags
   cd ../..
 fi
 
-# build lib
 if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
+  # build lib
   npm run dist
   cd temp_web
   git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib
@@ -47,11 +44,22 @@ if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
   git tag $TRAVIS_TAG
   git push origin master --tags
   cd ../..
-fi
 
-# build site
-if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
-  npm run deploy
+  # build theme-default
+  cd temp_web
+  git clone https://$GH_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
+  git config user.name "element_bot"
+  git config user.email "element_bot"
+  rm -rf *
+  cp -rf ../../packages/theme-default/** .
+  git add -A .
+  git commit -m "[build] $TRAVIS_TAG"
+  git tag $TRAVIS_TAG
+  git push origin master --tags
+  cd ../..
+
+  # build site
+  npm run deploy:build
   cd temp_web
   git clone https://$GH_TOKEN@github.com/ElemeFE/element.git && cd element
   git config user.name "element_bot"

+ 4 - 3
package.json

@@ -13,13 +13,14 @@
     "build:file": "node build/bin/iconInit.js & node build/bin/build-entry.js",
     "build:theme": "node build/bin/gen-cssfile && gulp build --gulpfile packages/theme-default/gulpfile.js && cp-cli packages/theme-default/lib lib/theme-default",
     "build:utils": "cross-env BABEL_ENV=utils babel src --out-dir lib --ignore src/index.js",
-    "clean": "rimraf lib && rimraf packages/*/lib && rimraf test/**/coverage",
-    "deploy": "npm run build:file && cooking build -c build/cooking.demo.js -p && echo element.eleme.io>>examples/element-ui/CNAME && gh-pages -d examples/element-ui --remote eleme && del examples/element-ui",
+    "clean": "rimraf lib && rimraf packages/*/lib && rimraf test/**/coverage && lerna clean --yes",
+    "deploy:build": "npm run build:file && cooking build -c build/cooking.demo.js -p && echo element.eleme.io>>examples/element-ui/CNAME",
+    "deploy": "npm run deploy:build && gh-pages -d examples/element-ui --remote eleme && del examples/element-ui",
     "dev": "npm run bootstrap && npm run build:file && cooking watch -c build/cooking.demo.js -p",
     "dist": "npm run clean && npm run build:file && npm run lint && cooking build -c build/cooking.conf.js,build/cooking.common.js,build/cooking.component.js -p && npm run build:utils && npm run build:theme",
     "dist:all": "node build/bin/build-all.js && npm run build:theme",
     "lint": "eslint src/**/* test/**/* packages/**/*.{js,vue} build/**/* --quiet",
-    "pub": "sh build/release.sh",
+    "pub": "git checkout master && git pull eleme master --rebase && sh build/release.sh",
     "pub:all": "npm run dist:all && lerna publish",
     "test": "npm run lint && CI_ENV=/dev/ karma start test/unit/karma.conf.js --single-run",
     "test:watch": "karma start test/unit/karma.conf.js"