Skip to content

Commit

Permalink
chore release script (#6167)
Browse files Browse the repository at this point in the history
* chore: release script

* chore: script
  • Loading branch information
ycjcl868 authored Feb 23, 2021
1 parent bede27c commit 36846f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"npm-run-all": "^4.1.5",
"open": "^7.0.4",
"prettier": "^2.0.5",
"yorkie": "^2.0.0"
"yorkie": "^2.0.0",
"git-repo-info": "^2.1.1"
},
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion scripts/release.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { yParser, execa, chalk } = require('@umijs/utils');
const { join } = require('path');
const { writeFileSync } = require('fs');
const getRepoInfo = require('git-repo-info');
const newGithubReleaseUrl = require('new-github-release-url');
const open = require('open');
const exec = require('./utils/exec');
Expand Down Expand Up @@ -121,7 +122,8 @@ async function release() {

// Push
logStep(`git push`);
await exec('git', ['push', 'origin', 'master', '--tags']);
const { branch } = getRepoInfo();
await exec('git', ['push', 'origin', branch, '--tags']);
}

// Publish
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7590,6 +7590,11 @@ git-remote-origin-url@^2.0.0:
gitconfiglocal "^1.0.0"
pify "^2.3.0"

git-repo-info@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/git-repo-info/-/git-repo-info-2.1.1.tgz#220ffed8cbae74ef8a80e3052f2ccb5179aed058"
integrity sha512-8aCohiDo4jwjOwma4FmYFd3i97urZulL8XL24nIPxuE+GZnfsAyy/g2Shqx6OjUiFKUXZM+Yy+KHnOmmA3FVcg==

git-semver-tags@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.3.tgz#48988a718acf593800f99622a952a77c405bfa34"
Expand Down

0 comments on commit 36846f4

Please sign in to comment.