Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第 261 期 《发布一个 NPM 包的正确步骤》 by 五柳 #257

Open
qhwa opened this issue Aug 12, 2019 · 0 comments
Open

第 261 期 《发布一个 NPM 包的正确步骤》 by 五柳 #257

qhwa opened this issue Aug 12, 2019 · 0 comments

Comments

@qhwa
Copy link
Contributor

qhwa commented Aug 12, 2019

  • 不要忘记打一个 git tag

我的自动化命令脚本:

#!/bin/bash
VERSION=$(node -p -e "require('./package.json').version")
npm publish && \
  git commit -m "bump version to $VERSION" -a && \
  git push origin HEAD && \
  git tag "v$VERSION" && \
  git push --tags

用法:

  1. 修改 package.json,把 version 修改成需要的版本号
  2. 运行 push-npm

参考:

  • npm version (虽然我不喜欢这个命令,也没有用到,但是还是值得一提)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant