name: publish_pypi

on:
  release:
    types: [created]

jobs:
  publish-pypi:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: "3.9"
      - name: Install dependencies
        run: |
          make deps
      - name: Publish to PyPi
        env:
          FLIT_USERNAME: "${{ secrets.PYPI_USERNAME }}"
          FLIT_PASSWORD: "${{ secrets.PYPI_PASSWORD }}"
        run: |
          make publish
