name: Publish python-client
on:
  push:
    tags:
      - "v*"
  workflow_dispatch:

jobs:
  publish_pypi:
    runs-on: ubicloud-standard-8
    if: startsWith(github.ref, 'refs/tags/v')
    container:
      image: ghcr.io/windmill-labs/python-client-builder
    steps:
      - uses: actions/checkout@v3
      - name: Upload python client
        env:
          PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
        run: |
          cd python-client
          ./publish.sh
