Files
Actions/.github/workflows/PublishOnPyPI.yml
2021-11-30 00:28:16 +01:00

54 lines
1.3 KiB
YAML

name: Publish on PyPI
on:
workflow_call:
inputs:
python_version:
description: 'Python version.'
required: false
default: '3.10'
type: string
artifact:
description: 'Name of the wheel artifact.'
required: true
type: string
secrets:
PYPI_TOKEN:
description: "Token for pushing releases to PyPI"
required: false
jobs:
PublishOnPyPI:
name: 🚀 Publish to PyPI
runs-on: ubuntu-latest
steps:
- name: 📥 Download artifacts '${{ inputs.artifact }}' from 'Package' job
uses: actions/download-artifact@v2
with:
name: ${{ inputs.artifact }}
path: dist/
- name: 🐍 Setup Python ${{ inputs.python_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python_version }}
- name: ⚙ Install dependencies for packaging and release
run: |
python -m pip install --upgrade pip
pip install wheel twine
- name: ⤴ Release Python package to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
- name: 🗑️ Delete packaging Artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: ${{ inputs.artifact }}