name: Nightly
on:
  schedule:
    - cron: "0 0 * * *"

jobs:
  build_and_publish:
    name: Build source distribution
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v2
        with:
          python-version: "3.9"
      - name: Install dependencies
        run: |
          python -m pip install -U pip
          python -m pip install build
      - name: Build the sdist
        run: python -m build --sdist .
        env:
          BUILD_AESARA_NIGHTLY: true
      - uses: pypa/gh-action-pypi-publish@v1.4.2
        with:
          user: __token__
          password: ${{ secrets.nightly_pypi_secret }}
