name: CD

on:
  push:
    branches:
      - main

jobs:
  prerelease:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 100
      - name: Pre-release (.devN)
        run: |
          git fetch --depth=1 origin +refs/tags/*:refs/tags/*
          pip install twine wheel
          ./scripts/release.sh
        env:
          TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
          JINA_SLACK_WEBHOOK: ${{ secrets.JINA_SLACK_WEBHOOK }}