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) + }) }) }