I need to publish it publicly to install it via pip, npm, cargo, etc. for public use.
Install packages from:
- PyPI (and other indexes) using requirement specifiers.
- VCS project urls.
- Local project directories.
- Local or remote source archives.
Although I’m not quite sure how you’re using “for public use” in that sentence.
[0] https://pip.pypa.io/en/stable/reference/pip_install/#id19
https://www.linode.com/docs/applications/project-management/...
[0] https://www.gnu.org/software/inetutils/manual/html_node/The-...
Installing from a generic git URL tends to work just fine, even if it's a bit more typing.