Commit a0682ed9 authored by Leopoldthecoder's avatar Leopoldthecoder Committed by Black Wayne

update release & deploy scripts

parent b5786701
var fs = require('fs');
var path = require('path');
var version = process.env.VERSION || require('../../package.json').version;
var content = { '1.0.9': '1.0', '1.1.6': '1.1', '1.2.9': '1.2', '1.3.7': '1.3' };
if (!content[version]) content[version] = '1.4';
var content = { '1.0.9': '1.0', '1.1.6': '1.1', '1.2.9': '1.2', '1.3.7': '1.3', '1.4.6': '1.4' };
if (!content[version]) content[version] = '2.0';
fs.writeFileSync(path.resolve(__dirname, '../../examples/versions.json'), JSON.stringify(content));
......@@ -8,6 +8,9 @@ if [ "$ROT_TOKEN" = "" ]; then
exit 0
fi
SUB_FOLDER=$(echo "2.0.0-alpha.1" | grep -o -E "\d+\.\d+")
echo $SUB_FOLDER
# release
if [ "$TRAVIS_TAG" ]; then
# build lib
......@@ -22,11 +25,11 @@ if [ "$TRAVIS_TAG" ]; then
git push origin master --tags
cd ../..
# build theme-default
# build theme-chalk
cd temp_web
git clone https://$ROT_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
git clone https://$ROT_TOKEN@github.com/ElementUI/theme-chalk.git && cd theme-chalk
rm -rf *
cp -rf ../../packages/theme-default/** .
cp -rf ../../packages/theme-chalk/** .
git add -A .
git commit -m "[build] $TRAVIS_TAG"
git tag $TRAVIS_TAG
......@@ -39,14 +42,14 @@ if [ "$TRAVIS_TAG" ]; then
git clone -b gh-pages https://$ROT_TOKEN@github.com/ElemeFE/element.git && cd element
# build sub folder
echo $TRAVIS_TAG
export SUB_FOLDER=$(echo "$TRAVIS_TAG" | grep -o -E "\d+\.\d+")
SUB_FOLDER=$(echo "$TRAVIS_TAG" | grep -o -E "\d+\.\d+")
echo $SUB_FOLDER
SUB_FOLDER='1.4'
SUB_FOLDER='2.0'
mkdir $SUB_FOLDER
rm -rf *.js *.css *.map static
# rm -rf *.js *.css *.map static
rm -rf $SUB_FOLDER/**
cp -rf ../../examples/element-ui/** .
# cp -rf ../../examples/element-ui/** .
cp -rf ../../examples/element-ui/** $SUB_FOLDER/
git add -A .
git commit -m "$TRAVIS_COMMIT_MSG"
......@@ -69,11 +72,11 @@ git commit -m "$TRAVIS_COMMIT_MSG"
git push origin master
cd ../..
# push dev theme-default
# push dev theme-chalk
cd temp_web
git clone -b $TRAVIS_BRANCH https://$ROT_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
git clone -b $TRAVIS_BRANCH https://$ROT_TOKEN@github.com/ElementUI/theme-chalk.git && cd theme-chalk
rm -rf *
cp -rf ../../packages/theme-default/** .
cp -rf ../../packages/theme-chalk/** .
git add -A .
git commit -m "$TRAVIS_COMMIT_MSG"
git push origin $TRAVIS_BRANCH
......
#!/usr/bin/env sh
git checkout dev
git checkout carbon
if test -n "$(git status --porcelain)"; then
echo 'Unclean working tree. Commit or stash changes first.' >&2;
......
git checkout master
git merge dev
#!/usr/bin/env sh
set -e
echo "Enter release version: "
......@@ -16,15 +13,10 @@ then
VERSION=$VERSION npm run dist
# publish theme
echo "Releasing theme-default $VERSION ..."
cd packages/theme-default
echo "Releasing theme-chalk $VERSION ..."
cd packages/theme-chalk
npm version $VERSION --message "[release] $VERSION"
if [[ $VERSION =~ "beta" ]]
then
npm publish --tag beta
else
npm publish
fi
npm publish --tag next
cd ../..
# commit
......@@ -33,16 +25,8 @@ then
npm version $VERSION --message "[release] $VERSION"
# publish
git push eleme master
git push eleme carbon
git push eleme refs/tags/v$VERSION
git checkout dev
git rebase master
git push eleme dev
if [[ $VERSION =~ "beta" ]]
then
npm publish --tag beta
else
npm publish
fi
npm publish --tag next
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment