Search code examples
pythongithubpackagepypi

LInk github repo with package on Pypi


I uploaded a python package on Pypi, but I'd also like to upload it to Github, so it can be opensource and anyone can contribute.

Is is possible to link the github repo with the already uploaded package on Pypi, so whenever I push something to the master branch, it also updates on Pypi?


Solution

  • In your Github repository there is a tab called Actions (next to Pull requests) where there are several actions like "Publish Python Package".

    Python Package Action

    Selecting it will automatically add the relevant Code to your repository. You then only need to store your credentials, like username & password.
    You can do so under Settings > Secrets > Actions

    Add repository secrets