question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publish package to multiple registries

See original GitHub issue

Is your feature request related to a problem? Please describe. When I added ability to select package registry (npm or github #599), I realize that will be nice to support publishing to both of them.

But ShipJS cant do this 😔

Describe the solution you’d like First solution that I figure out is add --publishOnly flag to trigger command. With that flag I can easily configurate github actions, will be like:

steps:
    # clone repo and checkout master 
  - uses: actions/checkout@master
    with:
      ref: master

    # setup node and npm with npmjs registry
  - uses: actions/setup-node@master
    with:
      registry-url: "https://registry.npmjs.org"
    
    # install shipjs and other dependencies
  - run: |
      if [ -f "yarn.lock" ]; then
        yarn install
      else
        npm install
      fi

    # trigger first release with all stuff
  - run: npm run release:trigger
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
      SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
  
    # setup node and npm with github registry
  - uses: actions/setup-node@master
    with:
      registry-url: "https://npm.pkg.github.com"
    
    # trigger second release that only publish package to registry
  - run: npm run release:trigger -- --publishOnly
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Describe alternatives you’ve considered I don’t know any alternatives. @eunjae-lee what do you think about that? May be you offer better solution for this case.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eunjae-leecommented, Mar 6, 2020

Hi @jeetiss ,

I’m not sure about this and the related PR #599. When we get enough of request, we can bake this in the setup command then. For now, I will close this issue and the PR.

Feel free to open them again if you want to continue to discuss on this 🙂

0reactions
eunjae-leecommented, Jan 15, 2020

@jeetiss oh actually I meant yarn publish.

➜ yarn publish --help

  Usage: yarn publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]

...

    --registry <url>                    override configuration registry

In my head, this will likely work:

NPM_AUTH_TOKEN=$GITHUB_TOKEN yarn publish --registry https://npm.pkg.github.com

If that is possible, I guess we can just document this and leave it to users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publishing npm packages to multiple registries with Github ...
This blog post covers what you need to know in order to automate publishing an npm package to Npm and Github package registries....
Read more >
How to publish on two different registry · Issue #69 - GitHub
The package.json and .npmrc are used by npm to define the registry used by your project and they allow to define only one....
Read more >
npm-multi-publish
Publish an npm package to multiple registries. ... Start using npm-multi-publish in your project by running `npm i npm-multi-publish`.
Read more >
Is there any way to configure multiple registries in a single ...
No, NPM does not support multiple registry except for scoped one. Refer to: https://docs.npmjs ...
Read more >
Work with Multiple npm Registries | by Allen Kim - Medium
This article shows how to work with multiple registries for different projects. 1. Setup a user-wide registry and credentials.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found