Skip to content

2. How Does It Work?

RilDev edited this page Oct 27, 2020 · 2 revisions

Step By Step

gh-packages will perform all the following actions to publish your package:

  1. Update your package number in your package.json file and commit it.
  2. Create a new branch gh-packages which is a copy of your current branch.
  3. (Optional) if the -c or --command flag is used, it will perform the custom command on the project files.
  4. Publish the package to NPM.
  5. Switch back to the original branch.

This is what the log will look like:

rildev@WorkStation:~/Projects/gh-packages$ gh-packages
v0.0.3
[master 3c14106] update version number
 1 file changed, 1 insertion(+), 1 deletion(-)
 To github.com:RilDev/gh-packages.git
    1723500..3c14106  master -> master
    Switched to a new branch 'gh-packages'
    [gh-packages a00c88e] ready to publish
     2 files changed, 10 insertions(+), 9 deletions(-)
     remote:
     remote: Create a pull request for 'gh-packages' on GitHub by visiting:
     remote:      https://github.com/RilDev/gh-packages/pull/new/gh-packages
     remote:
     To github.com:RilDev/gh-packages.git
      * [new branch]      gh-packages -> gh-packages
      * npm notice
      * npm notice 📦  [email protected]
      * npm notice === Tarball Contents ===
      * npm notice 1.6kB cli.js
      * npm notice 597B  package.json
      * npm notice 646B  readme.md
      * npm notice === Tarball Details ===
      * npm notice name:          gh-packages
      * npm notice version:       0.0.3
      * npm notice package size:  1.4 kB
      * npm notice unpacked size: 2.8 kB
      * npm notice shasum:        6fd79be1b85ebb3e1d63f7496785b720e490853c
      * npm notice integrity:     sha512-38vwHPK66RdD0[...]8/U0PF4+xv6Ow==
      * npm notice total files:   3
      * npm notice
      * + [email protected]
      * Your branch is up to date with 'origin/master'.
      * Switched to branch 'master'

Note: If you don't have an NPM account yet, you can create one here: create NPM account

Clone this wiki locally