diff --git a/.travis.yml b/.travis.yml index 6d31c674ce..c055db4396 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,19 @@ cache: directories: - node_modules node_js: -- '0.12' +- "0.12" - iojs -before_script: npm install -g codeclimate-test-reporter + +before_script: ./tools/setup-git.sh script: make test-travis +after_success: ./tools/merge-development-with-master.sh + notifications: slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK + before_deploy: - make prepublish -after_deploy: -- make publish-cli -- make publish-runtime + deploy: provider: npm email: sebmck@gmail.com @@ -24,3 +26,8 @@ deploy: branch: master tags: true repo: babel/babel + +after_deploy: +- make publish-cli +- make publish-runtime +- make rebuild-website diff --git a/Makefile b/Makefile index 8451d96f65..4e2c0eb248 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ BROWSERIFY_IGNORE = -i esprima-fb export NODE_ENV = test -.PHONY: clean test test-cov test-clean test-travis test-simple test-all test-browser test-parser publish build bootstrap publish-core publish-runtime build-core watch-core build-core-test clean-core prepublish +.PHONY: clean test test-cov test-clean test-travis test-simple test-all test-browser test-parser publish build bootstrap publish-core publish-runtime build-website build-core watch-core build-core-test clean-core prepublish build-core: clean-core node $(BABEL_CMD) src --out-dir lib --copy-files @@ -105,6 +105,9 @@ publish-runtime: publish-cli: @./tools/publish-cli.sh +build-website: + @./tools/build-website.sh + bootstrap: npm list --global --depth 1 babel >/dev/null 2>&1 && npm uninstall -g babel || true npm install diff --git a/tools/build-website.sh b/tools/build-website.sh new file mode 100755 index 0000000000..e3d30c27a1 --- /dev/null +++ b/tools/build-website.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +git clone git@github.com:babel/babel.github.io.git +cd babel.github.io +ln -s .. _babel +make build +git commit -am "${TRAVIS_TAG}" +git push "https://${GH_TOKEN}@github.com/babel/babel.github.io" diff --git a/tools/merge-development-with-master.sh b/tools/merge-development-with-master.sh new file mode 100755 index 0000000000..532c95816c --- /dev/null +++ b/tools/merge-development-with-master.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +if [ "$TRAVIS_BRANCH" != "development" ]; then + exit 0; +fi + +git checkout master +git merge "$TRAVIS_COMMIT" +git push "https://${GH_TOKEN}@github.com/babel/babel" diff --git a/tools/publish-cli.sh b/tools/publish-cli.sh index 861752c1c8..198a3ae628 100755 --- a/tools/publish-cli.sh +++ b/tools/publish-cli.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e LAST_TAG=$(git describe $(git rev-list --tags --max-count=1)) TAG_DIFF=$(git diff $LAST_TAG -- packages/babel-cli/) diff --git a/tools/setup-git.sh b/tools/setup-git.sh new file mode 100644 index 0000000000..82171bdf78 --- /dev/null +++ b/tools/setup-git.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -e + +git config user.name "sebmckbot" +git config user.email "sebmckbbot@gmail.com"