Files
Actions/doc/JobTemplate/PublishOnPyPI.rst
Patrick Lehmann c78c1c8503 Added Sphinx based documentation.
(cherry picked from commit f9f5dd5117a14ba31a3a9113a1de2c12c624dffb)
2022-10-29 22:42:09 +02:00

87 lines
1.6 KiB
ReStructuredText

PublishOnPyPI
#############
Publish a source (``*.tar.gz``) and wheel (``*.whl``) packages to `PyPI <https://pypi.org/>`__.
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
jobs:
# ...
PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r0
if: startsWith(github.ref, 'refs/tags')
with:
artifact: Package
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Complex Example
===============
.. code-block:: yaml
jobs:
# ...
PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r0
if: startsWith(github.ref, 'refs/tags')
needs:
- Params
- Package
with:
python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
requirements: -r dist/requirements.txt
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.Package }}
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Template Parameters
*******************
python_version
==============
Python version used for uploading the package contents via `twine` to PyPI.
**Default:** 3.11
requirements
============
List of requirements to be installed for uploading the package contents to PyPI.
**Default:** wheel, twine
artifact
========
Name of the artifact containing the package(s).
Secrets
*******
PYPI_TOKEN
==========
The token to access the package at PyPI for uploading new data.
Template Results
****************
*None*
Dependencies
************
* actions/download-artifact
* actions/setup-python
* geekyeggo/delete-artifact