From 9145d50b0f8833400fd79009bee65196345678bc Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sat, 21 Jul 2018 16:13:54 +0800 Subject: [PATCH] chore: update travis config --- .npmrc.template | 3 --- .travis.yml | 2 +- antd-tools/gulpfile.js | 11 ++++++++--- 3 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 .npmrc.template diff --git a/.npmrc.template b/.npmrc.template deleted file mode 100644 index a2ddeece3..000000000 --- a/.npmrc.template +++ /dev/null @@ -1,3 +0,0 @@ -//registry.npmjs.org/:_authToken=${NPM_TOKEN} -loglevel=info -registry=https://registry.npmjs.org/ diff --git a/.travis.yml b/.travis.yml index d7999ca63..3cb27d703 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/antd-tools/gulpfile.js b/antd-tools/gulpfile.js index f9e6d0e55..336620da8 100644 --- a/antd-tools/gulpfile.js +++ b/antd-tools/gulpfile.js @@ -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) + }) }) }