The blessed :octocat: GitHub Action, for publishing your 📦 distribution files to PyPI: https://github.com/marketplace/actions/pypi-publish
Find a file
Sviatoslav Sydorenko f36788ee44
Add a YAMLlint config
2019-08-23 13:10:51 +02:00
.github Add SECURITY text 2019-05-26 17:50:09 +02:00
.gitignore Initial commit 2019-03-27 19:44:44 +01:00
.yamllint Add a YAMLlint config 2019-08-23 13:10:51 +02:00
action.yml Adapt to new yml based github actions 2019-08-23 10:53:21 +02:00
Dockerfile Adapt to new yml based github actions 2019-08-23 10:53:21 +02:00
LICENSE.md 📄🐳 Relicense the repo to BSD 3-clause 2019-03-29 23:21:12 +01:00
README.md Adapt to new yml based github actions 2019-08-23 10:53:21 +02:00
twine-upload.sh Adapt to new yml based github actions 2019-08-23 10:53:21 +02:00

PyPI publish GitHub Action

This action allows you to upload your Python distribution package to PyPI.

Usage

To use the action add the following step to your workflow file (e.g.: .github/workflows/main.yml)

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

A common use case is to upload packages only on a tagged commit, to do so add a filter to the step:

  if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

So the full step would look like:

- name: Publish package
  if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
  uses: pypi/gh-action-pypi-publish@master
  with:
    user: __token__
    password: ${{ secrets.pypi }}

The example above uses the new API token feature of PyPI, which is recommended to restrict the access the action has.

The secret used in ${{ secrets.pypi_password }} needs to be created on the settings page of your project on GitHub. See Creating & using secrets.

License

The Dockerfile and associated scripts and documentation in this project are released under the BSD 3-clause license.