ortega2247/pypi-upload-action

Repository files navigation

This action uploads python distribution packages located in the dist/ directory to PyPI.

This action assumes that a python environment is set up. Python can be set up with conda as well

Upload packages to PyPI

- name: Publish a Python distribution to PyPI
  uses: ortega2247/pypi-upload-action@master
  with:
    user: __token__
    password: ${{ secrets.pypi_password }}

To upload packages to TestPyPI

- name: Publish a Python distribution to PyPI
  uses: ortega2247/pypi-upload-action@master
  with:
    user: __token__
    password: ${{ secrets.test_pypi_password }}
    repository_url: https://test.pypi.org/legacy/

If python distribution packages are located in a directory other than dist

- name: Publish a Python distribution to PyPI
  uses: ortega2247/pypi-upload-action@master
  with:
    user: __token__
    password: ${{ secrets.test_pypi_password }}
    repository_url: https://test.pypi.org/legacy/
    packages_dir: my_directory

Limit releases to tagged pushes

- name: Publish a Python distribution to PyPI
  if: startsWith(.ref, 'refs/tags/')
  uses: ortega2247/pypi-upload-action@master
  with:
    user: __token__
    password: ${{ secrets.test_pypi_password }}
    repository_url: https://test.pypi.org/legacy/
    packages_dir: my_directory

To use this action you need to get an API token from PyPI. Then, use this token to create a secret

About

action to upload a python package to PyPI

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •