Merge pull request #1173 from QingWei-Li/fix/release-sh

Fix release script
This commit is contained in:
baiyaaaaa 2016-11-18 16:30:21 +08:00 committed by GitHub
commit 2053742e90
3 changed files with 26 additions and 7 deletions

19
build/git-release.sh Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env sh
git checkout dev
if test -n "$(git status --porcelain)"; then
echo 'Unclean working tree. Commit or stash changes first.' >&2;
exit 128;
fi
if ! git fetch --quiet 2>/dev/null; then
echo 'There was a problem fetching your branch. Run `git fetch` to see more...' >&2;
exit 128;
fi
if test "0" != "$(git rev-list --count --left-only @'{u}'...HEAD)"; then
echo 'Remote history differ. Please pull changes.' >&2;
exit 128;
fi
echo 'No conflicts.' >&2;

View File

@ -1,8 +1,4 @@
git checkout dev
git pull eleme dev --rebase
git checkout master
git merge dev
#!/usr/bin/env sh
set -e
echo "Enter release version: "
read VERSION
@ -29,7 +25,11 @@ then
npm version $VERSION --message "[release] $VERSION"
# publish
git push eleme refs/tags/v$VERSION
git push eleme dev
git checkout master
git merge dev
git push eleme master
git push eleme refs/tags/v$VERSION
npm publish
fi

View File

@ -22,7 +22,7 @@
"dist:all": "node build/bin/build-all.js && npm run build:theme",
"i18n": "node build/bin/i18n.js",
"lint": "eslint src/**/* test/**/* packages/**/*.{js,vue} build/**/* --quiet",
"pub": "sh build/release.sh",
"pub": "sh build/git-release.sh && 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"