diff --git a/.github/workflows/python-sdk-publish.yaml b/.github/workflows/python-sdk-publish.yaml new file mode 100644 index 00000000000000..392a672263b000 --- /dev/null +++ b/.github/workflows/python-sdk-publish.yaml @@ -0,0 +1,33 @@ +name: "Run Python SDK Publish" + +on: + workflow_dispatch: + push: + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - uses: ./.github/actions/python-setup + with: + pyproject_directory: ./ecosystem/python/sdk + + - name: Build project for distribution + run: poetry build + working-directory: ./ecosystem/python/sdk + + - name: Check Version + id: check-version + run: | + [[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ $(grep $(poetry version --short) CHANGELOG.md) =~ $(poetry version --short) ]] || echo prerelease=true >> $GITHUB_OUTPUT + working-directory: ./ecosystem/python/sdk + + - name: Publish to PyPI + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + run: poetry publish + working-directory: ./ecosystem/python/sdk