chore: update travis config

This commit is contained in:
tangjinzhou 2018-07-21 16:13:54 +08:00
parent 427edd610e
commit da57566533
3 changed files with 9 additions and 7 deletions

View File

@ -1,3 +0,0 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
loglevel=info
registry=https://registry.npmjs.org/

View File

@ -8,7 +8,7 @@ script:
- cp ./scripts/.npmrc.template $HOME/.npmrc
- COVERAGE=true npm run test
- npm run codecov
- npm run pub-with-ci
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then npm run pub-with-ci
- bash ./scripts/deploy-to-gh-pages.sh
env:
matrix:

View File

@ -134,13 +134,15 @@ function compile (modules) {
function tag () {
console.log('tagging')
const { version } = packageJson
execSync(`git config --global user.email ${process.env.GITHUB_USER_EMAIL}`)
execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`)
execSync(`git tag ${version}`)
execSync(`git push origin ${version}:${version}`)
execSync('git push origin master:master')
console.log('tagged')
}
function githubRelease () {
function githubRelease (done) {
const changlogFiles = [
path.join(cwd, 'CHANGELOG.en-US.md'),
path.join(cwd, 'CHANGELOG.zh-CN.md'),
@ -180,6 +182,8 @@ function githubRelease () {
tag_name: version,
name: version,
body: changelog,
}).then(() => {
done()
})
}
gulp.task('check-git', (done) => {
@ -204,8 +208,9 @@ function publish (tagString, done) {
const publishNpm = process.env.PUBLISH_NPM_CLI || 'npm'
runCmd(publishNpm, args, (code) => {
tag()
githubRelease()
done(code)
githubRelease(() => {
done(code)
})
})
}