From d640b5f788bcda024d3e06c680e066d5a50e4a1d Mon Sep 17 00:00:00 2001 From: "Ankush Pala ankush@lastmileai.dev" <> Date: Wed, 13 Mar 2024 14:00:27 -0400 Subject: [PATCH] [ci/cd] Publish Workflow for Python SDK title --- .github/workflows/publish_python_sdk.yml | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/publish_python_sdk.yml diff --git a/.github/workflows/publish_python_sdk.yml b/.github/workflows/publish_python_sdk.yml new file mode 100644 index 000000000..42e6c5970 --- /dev/null +++ b/.github/workflows/publish_python_sdk.yml @@ -0,0 +1,45 @@ +# Build and publish the python-sdk to pypi. This workflow does NOT update the version number. Open a pr to update the version number and merge it to master before running this workflow. +# This workflow is triggered manually. see https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow +name: Publish Python SDK to PyPI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: +jobs: + build-release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" # don't know what the impact of this is + + - name: Build editor & client packages. # Otherwise the aiconfig local editor will have a blank screen. This gets included in the python package + run: | + cd python/src/aiconfig/editor/client && yarn && yarn build + - name: Build Package + run: | + pip install build && cd python && python -m build + + pypi-publish: + runs-on: ubuntu-latest + needs: + - build-release + permissions: + id-token: write + + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: python/dist/ +