name: job_pypi

on:
  workflow_call:
    inputs:
      version:
        required: true
        type: string

jobs:
  build:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.9'
      - name: Install dependencies
        run: |
          python3 -m pip install --upgrade pip
          pip3 install setuptools wheel twine
      - name: Build and publish
        env:
          TWINE_USERNAME: __token__
          TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
        run: |
          python setup.py sdist bdist_wheel
          twine upload dist/*