From 1e8636f54b804223edacb1351a44d286dd492569 Mon Sep 17 00:00:00 2001 From: Utkarsh Dixit Date: Wed, 20 Mar 2024 15:24:04 +0530 Subject: [PATCH] fet: github workflow --- .github/workflows/release.yaml | 48 +++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3621de5805d..4ebc0b7edd8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,41 +35,63 @@ jobs: - name: Build core package and install locally run: | cd core - if [[ $GITHUB_REF == refs/tags/v* ]]; then - sed -i "s/version=.*/version='${{ env.PACKAGE_VERSION }}',/" setup.py - fi python setup.py sdist bdist_wheel echo "Installing package locally" pip install -e . + if [[ $GITHUB_REF == refs/tags/v* ]]; then + sed -i "s/version=.*/version='${{ env.PACKAGE_VERSION }}',/" setup.py + echo "Updated version in setup.py (core)" + fi cd .. + - name: Publish package (Core) + if: startsWith(github.ref, 'refs/tags/v') + run: | + cd core && twine upload dist/* && cd ../ + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Build langchain package and install locally run: | cd langchain + python setup.py sdist bdist_wheel + echo "Installing package locally" + pip install -e . if [[ $GITHUB_REF == refs/tags/v* ]]; then sed -i "s/version=.*/version='${{ env.PACKAGE_VERSION }}',/" setup.py sed -i "s/composio_core===.*/composio_core==='${{ env.PACKAGE_VERSION }}',/" pyproject.toml sed -i "s/composio_core===.*/composio_core==='${{ env.PACKAGE_VERSION }}'/" requirements.txt + echo "Updated version in pyproject.toml and requirements.txt" fi - python setup.py sdist bdist_wheel - echo "Installing package locally" - pip install -e . cd .. + + - name: Publish package (Langchain) + if: startsWith(github.ref, 'refs/tags/v') + run: | + cd core && twine upload dist/* && cd ../ + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Build crew package and install locally run: | cd crew_ai - if [[ $GITHUB_REF == refs/tags/v* ]]; then - sed -i "s/version=.*/version='${{ env.PACKAGE_VERSION }}',/" setup.py - fi python setup.py sdist bdist_wheel echo "Installing package locally" pip install -e . + if [[ $GITHUB_REF == refs/tags/v* ]]; then + sed -i "s/version=.*/version='${{ env.PACKAGE_VERSION }}',/" setup.py + sed -i "s/composio_core===.*/composio_langchain==='${{ env.PACKAGE_VERSION }}',/" pyproject.toml + sed -i "s/composio_core===.*/composio_langchain==='${{ env.PACKAGE_VERSION }}'/" requirements.txt + echo "Updated version in pyproject.toml and requirements.txt" + fi cd .. - - - name: Publish package + + - name: Publish package (Crew AI) if: startsWith(github.ref, 'refs/tags/v') run: | - twine upload dist/* + cd core && twine upload dist/* && cd ../ env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} \ No newline at end of file