-
Notifications
You must be signed in to change notification settings - Fork 4.3k
97 lines (86 loc) · 3.32 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build and Release
on:
push:
branches:
- master
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
pip install -r core/requirements.txt
pip install -r langchain/requirements.txt
pip install -r crew_ai/requirements.txt
- name: Extract version from tag
id: tag_version
run: |
echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
echo $PACKAGE_VERSION
- 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
echo "Updated version in setup.py (core)"
fi
python setup.py sdist bdist_wheel
echo "Installing package locally"
pip install -e .
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
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"
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
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
python setup.py sdist bdist_wheel
echo "Installing package locally"
pip install -e .
cd ..
- name: Publish package (Crew AI)
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 }}