GitHub Action
pypi-github-sync
This action allows you to upload your Python package to PyPI automatically using latest GitHub version tag as release version.
Running a Docker container, this action will clone your repo, fetch its latest release tag, modify setup.py
and/or pyproject.toml
, build and finally push to PyPI.
Also, with current procedure your GitHub repo remains untouched. That means the version parameter in your setup file will not be modified and its value does not matter.
You can leave a dummy value, for example:
setup(
version="0.0.0",
...
)
In your GitHub repo, create a workflow file or append to an existing one. (e.g. .github/workflows/release.yml
)
Mandatory parameters are:
- name: pypi-github-sync
uses: PabloLec/[email protected]
with:
github_repo: YOUR_USERNAME/YOUR_REPO
twine_username: ${{ secrets.TWINE_USERNAME }}
twine_password: ${{ secrets.TWINE_PASSWORD }}
You will need to change YOUR_USERNAME
and YOUR_REPO
values and set your PyPI username and password in your repository secrets (See the docs for reference).
↪️ See EXAMPLE.yml for a real world example.
Your github repository with format USERNAME/REPO
as in URLs. For example this repo is PabloLec/pypi-github-sync
.
Your PyPI username, add TWINE_USERNAME
to your repository secrets.
Your PyPI password, add TWINE_PASSWORD
to your repository secrets.
The repository used for package uploading. Defaults to main PyPI repo, you can use others like PyPI test repo with https://test.pypi.org/legacy/
.
Verify build metadata before publication, defaults to false.
Do not raise an error if version already exists on repo, defaults to false.
Verbose output for twine upload, defaults to false.
Any contribution is welcome.
To report a bug or offer your help, simply open a new issue.
You can also open an issue if you want a new feature to be implemented.