-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into chore/restructure
- Loading branch information
Showing
28 changed files
with
1,058 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Build and Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
package_version: ${{ steps.extract_version.outputs.package_version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- 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 | ||
pip install -r lyzr/requirements.txt | ||
- name: Extract version from tag | ||
id: extract_version | ||
run: echo "::set-output name=package_version::${GITHUB_REF#refs/tags/v}" | ||
|
||
|
||
build-and-publish: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 1 | ||
# fail-fast: true | ||
matrix: | ||
package: [core, langchain, autogen, crew_ai, lyzr] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: pip install -r ${{ matrix.package }}/requirements.txt | ||
|
||
- name: Update version and dependencies | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
cd ${{ matrix.package }} | ||
sed -i "s/composio_core===.*/composio_core===${{ needs.setup.outputs.package_version }}\",/" pyproject.toml | ||
sed -i "s/composio_core===.*/composio_core===${{ needs.setup.outputs.package_version }}\"/" requirements.txt | ||
sed -i "s/composio_langchain===.*/composio_langchain===${{ needs.setup.outputs.package_version }}\",/" pyproject.toml | ||
sed -i "s/composio_langchain===.*/composio_langchain===${{ needs.setup.outputs.package_version }}\"/" requirements.txt | ||
echo "Updated version in setup.py, pyproject.toml, and requirements.txt" | ||
echo "<----- Pyproject.toml ----->" | ||
cat pyproject.toml | ||
echo "<----- Requirements.txt ----->" | ||
cat requirements.txt | ||
cd .. | ||
- name: Build and install package locally | ||
run: | | ||
cd ${{ matrix.package }} | ||
pip install build | ||
python -m build | ||
pip install -e . | ||
cd .. | ||
env: | ||
RELEASE_VERSION: ${{ needs.setup.outputs.package_version }} | ||
|
||
- name: Publish package | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
pip install twine | ||
cd ${{ matrix.package }} && twine upload dist/* && cd ../ | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.