From 5451fdfc8fb0dab181ee9310e1b747841de10b59 Mon Sep 17 00:00:00 2001 From: Christopher Gerber Date: Tue, 5 Nov 2024 10:59:47 -0800 Subject: [PATCH 1/2] github workflows for publishing agentkit and langchain to pypi --- .github/workflows/publish_agentkit.yml | 51 +++++++++++++++++++++++++ .github/workflows/publish_langchain.yml | 51 +++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 .github/workflows/publish_agentkit.yml create mode 100644 .github/workflows/publish_langchain.yml diff --git a/.github/workflows/publish_agentkit.yml b/.github/workflows/publish_agentkit.yml new file mode 100644 index 000000000..005540925 --- /dev/null +++ b/.github/workflows/publish_agentkit.yml @@ -0,0 +1,51 @@ +name: Release AgentKit to PyPI + +on: + workflow_dispatch: + +jobs: + deploy-agentkit: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./cdp-agentkit-core + environment: + name: pypi + url: https://pypi.org/p/cdp-agentkit-core + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: latest + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: ./cdp-agentkit-core/.venv + key: venv-agentkit-${{ runner.os }}-3.10-${{ hashFiles('cdp-agentkit-core/poetry.lock') }} + + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --with dev + + - name: Build package + run: python -m build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/publish_langchain.yml b/.github/workflows/publish_langchain.yml new file mode 100644 index 000000000..3e03db92e --- /dev/null +++ b/.github/workflows/publish_langchain.yml @@ -0,0 +1,51 @@ +name: Release LangChain to PyPI + +on: + workflow_dispatch: + +jobs: + deploy-langchain: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./cdp-langchain + environment: + name: pypi + url: https://pypi.org/p/cdp-langchain + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: latest + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: ./cdp-langchain/.venv + key: venv-langchain-${{ runner.os }}-3.10-${{ hashFiles('cdp-langchain/poetry.lock') }} + + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --with dev + + - name: Build package + run: python -m build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} From 332f81d7f69b1024dc9ef7ea943e5b75cd89d436 Mon Sep 17 00:00:00 2001 From: Christopher Gerber Date: Tue, 5 Nov 2024 11:45:16 -0800 Subject: [PATCH 2/2] implementing John's feedback --- .github/workflows/publish_agentkit.yml | 4 ++-- .github/workflows/publish_langchain.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_agentkit.yml b/.github/workflows/publish_agentkit.yml index 005540925..d3c67ef9c 100644 --- a/.github/workflows/publish_agentkit.yml +++ b/.github/workflows/publish_agentkit.yml @@ -40,10 +40,10 @@ jobs: - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --with dev + run: poetry install - name: Build package - run: python -m build + run: poetry build - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/publish_langchain.yml b/.github/workflows/publish_langchain.yml index 3e03db92e..8cb0e84e3 100644 --- a/.github/workflows/publish_langchain.yml +++ b/.github/workflows/publish_langchain.yml @@ -40,10 +40,10 @@ jobs: - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --with dev + run: poetry install - name: Build package - run: python -m build + run: poetry build - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1