# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
  release:
    types: [created]
  workflow_dispatch:
  push:
    tags:
      - '[0-9]+.[0-9]+.[0-9]+-dev'
      - '[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+'
      - '[0-9]+.[0-9]+.[0-9]+-rc'
      - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
      - '[0-9]+.[0-9]+.[0-9]+'

jobs:
  pypi:
    runs-on: ubuntu-latest
    name: "pypi"
    steps:
      - uses: davidslusser/actions_python_pypi@test
        with:
          build_command: "python setup.py sdist bdist_wheel"
          pypi_username: ${{ secrets.PYPI_USERNAME }}
          pypi_password: ${{ secrets.PYPI_PASSWORD }}
