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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing to multiple registries #194

Closed
limonte opened this issue Sep 24, 2019 · 8 comments
Closed

Publishing to multiple registries #194

limonte opened this issue Sep 24, 2019 · 8 comments

Comments

@limonte
Copy link

limonte commented Sep 24, 2019

GitHub Package Registry is in public beta stage now 馃帀 馃帀 馃帀

Which means that developers will want to publish their npm packages to both npm and GitHub registries.

Is it possible to configure semantic-release so it'll publish to multiple registries at the same time?

@gr2m
Copy link
Member

gr2m commented Sep 24, 2019

It should now. I tried a while ago and the only blocker was that GPR created tags & releases when publishing a package, that behavior has recently been removed so no conflict errors should occur. All you'd need to do is set the different registry URL and set NPM_TOKEN to GITHUB_TOKEN in your action. Can you give it a try? Would love to know myself

@limonte
Copy link
Author

limonte commented Sep 25, 2019

Thank you @gr2m for the feedback!

All you'd need to do is set the different registry URL and set NPM_TOKEN to GITHUB_TOKEN in your action.

Could you please be more specific on how can I set the different registry URL?

@gr2m
Copy link
Member

gr2m commented Sep 25, 2019

It came up in the discussion here:
#161

I think that the GitHub registry now also works as a proxy for npm's registry, I don't know if that means that it will publish to both or only fallback to the latter on install

@pvdlg
Copy link
Member

pvdlg commented Sep 26, 2019

I don't think publishing to two different registry is a good idea. It just create an opportunity for inconsistencies.

As the GitHub Registry is a proxy to the npm one, you can publish to the npm registry and your package is going to be available to users using the GitHub one.

If you publish to the GitHub one, I guess your package will be accessible only to the GitHub registry users.

@gr2m
Copy link
Member

gr2m commented Sep 26, 2019

As the GitHub Registry is a proxy to the npm one, you can publish to the npm registry and your package is going to be available to users using the GitHub one.

That's a good point, GitHub kinda solved to need to publish to two registries for a transitional time.

Does that resolve your problem Limon?

@pvdlg
Copy link
Member

pvdlg commented Oct 22, 2019

Closing as no response provided

@pvdlg pvdlg closed this as completed Oct 22, 2019
@lifeiscontent
Copy link

@pvdlg it seems given the docs on setup-node github action that you should just set the NPM_TOKEN to what the GITHUB_TOKEN should be, I've done this but semantic release seems to error.

https://github.com/actions/setup-node

https://github.com/lifeiscontent/isomorphic-querystring/blob/master/.github/workflows/ci.yml

can we update semantic release to accommodate what setup-node does?

@rafegoldberg
Copy link

rafegoldberg commented Jul 6, 2020

@lifeiscontent setting the NPM_TOKEN env variable for the semantic release step has worked for me in various GitHub workflows. Pretty simple to set it up in the config file:

jobs:
  release:
    steps:
      - name: Build and publish release.
        run: npx semantic-release
        env:
          GH_TOKEN: secrets.GITHUB_TOKEN
          NPM_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }}

(Or you could use the simple template repo I've set up!)

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

No branches or pull requests

5 participants