-
Notifications
You must be signed in to change notification settings - Fork 508
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
Have templates publish to GitHub packages #854
Comments
I think that is currently out-of-scope for TSDX. How, when, and where people publish packages tends to be very different per author and TSDX does not currently have an opinion on that or control your publish in any way. Maybe in the future TSDX will have an opinionated semantic release style automated publish in the templates, but it does not currently touch publishing
Most people publish solely to NPM so I think it is only useful to a small proportion of folks |
Created my own GitHub action that can deploy to both when committing to master (with an incremented version)
NOTE: A GitHub secret for Additionally the package.json will need to include this config:
|
Just wanted to leave another comment and thank you and all the contributors of this project! This made it extremely easy to create a TS (react) npm package! Feel free to point to that above GitHub action config for other developers to use in their own projects. |
Thanks a lot. I modified the action slightly because my username has uppercase characters. So,
|
Current Behavior
Currently, npm publish runs yarn prepare script to build the package then deploys to npm for the logged in user.
Desired Behavior
Have an CLI option and config file to be able to also deploy to GitHub packages. This could be wrapped into the prepare script or added as an additional script that will use the config to deploy to GitHub packages instead.
Suggested Solution
Since deploying to GitHub packages requires logging in with GitHub credentials to a different registry and adding a publishConfig to the package.json, it would probably be best to add a new script that will run npm login to the GitHub registry and apply the config credentials. This would also need to edit the package.json to add the publishConfig before running npm publish. Then also do the clean up to remove it so you can later run npm publish with normal login.
Since this would change the user's login to the GitHub registry it would also be a good idea to have the config include their npm credentials so the normal prepare script can log them into npm normally.
Another alternative solution would be to update the GitHub actions to automatically deploy to GitHub packages. (now that I type this I think that would definitely be the route to take since developers can just add the secret token directly to the repo then have it work on all commits to master)
Who does this impact? Who is this for?
This would be useful for all developers because deploying to GitHub packages is becoming increasingly popular.
Describe alternatives you've considered
Currently, I am manually logging in with both npm credentials and publishing to each manually.
The text was updated successfully, but these errors were encountered: