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

automate versioning and publishing to npm #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yuhanasy
Copy link
Collaborator

We add this into scripts

"scripts": {
    "build": "preconstruct build",
    "preversion": "git stash; git checkout master; git pull origin master",
    "postversion": "yarn release",
    "postpublish": "git push origin --all; git push origin --tags",
    "release": "yarn build && yarn publish",
    "format": "prettier --write ./**/*"
  },

So, to publish new version into npm registry we only need to run this on our local repos,

  • yarn version or,
  • yarn version --major or,
  • yarn version --minor or,
  • yarn version --major

Then it will automate update version in package.json, and update tag in git, publish to npm registry, and push into github. Hope so 🙏🏻

@yuhanasy yuhanasy requested a review from nasrul21 July 28, 2020 08:07
@yuhanasy
Copy link
Collaborator Author

sequence of the command that will be executed when running yarn version, it would be:

  1. preversion
  2. version
  3. postversion
  4. release
  5. build
  6. publish
  7. postpublish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant