* chore: update linting workflows to include dev branch in merge_group * Update README.md Add 1.0 banner * Update README.md * chore: update package versions in pyproject.toml files * Refactor "created_at" column type for consistency and fix cancel middleware (#2316) * chore: update linting workflows to include dev branch in merge_group * Update README.md Add 1.0 banner * Update README.md * chore: update package versions in pyproject.toml files * refactor: update "created_at" column type to use the "sa" module for consistency * Update README.md Add 1.0 banner * chore: Remove unused import in ToolCallingAgent.py * fix: adapt RequestCancelledMiddleware to handle cancelled requests * chore: Remove unused import in test_helper_components.py * refactor: Declare queue variable with explicit type in RequestCancelledMiddleware --------- Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com> * chore: Update AstraDB.py imports and method signature for search_documents * chore: Update package versions in pyproject.toml files * chore: Update run-name in release.yml for Langflow Release * fix: add call to _add_documents_to_vector_store in AstraDB component * chore: Fix missing parentheses in RequestCancelledMiddleware * chore: Update pydantic-settings and tenacity versions The commit updates the versions of the `pydantic-settings` and `tenacity` packages in the `poetry.lock` file. The `pydantic-settings` version is updated from 2.3.3 to 2.3.4, and the `tenacity` version is updated from 8.4.1 to 8.4.2. * Update README.md Add 1.0 banner * fix fetch data to work even with autologin true * format code * deactivate stop button until we have a better solution (#2337) * consistent auth error status code * [Fix] unhandled http errors in background tasks (#2326) * handle exceptions for background task * revert changes that is not related to this HTTP handler exception * Refactor model GoogleGenerativeAIModel (#2251) * refactor model GoogleGenerativeAIModel * adds model options --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * Fix .env values not being honored in CLI (#2336) * chore: Update launch.json to include environment file The launch.json file was updated to include the environment file path for the "run" command in the "Python: Flask" configuration. This change ensures that the necessary environment variables are loaded when running the backend base of Langflow frontend. The previous configuration had the environment variables set in the "env" field, but it has been removed as it is redundant with the new environment file inclusion. * chore: Update dotenv import and environment variable handling This commit updates the import statement for the `dotenv` module in the `__main__.py` file. It adds the `dotenv_values` function to the import statement to enable loading environment variables from a file. Additionally, it introduces a new section of code that maps environment variables to their corresponding variables and types, allowing for more flexible and dynamic configuration. The commit also updates the `run` function to update variables based on environment variables, if they are present. This change improves the handling of environment variables and enhances the configurability of the application. * deactivate stop button until we have a better solution (#2337) * consistent auth error status code * [Fix] unhandled http errors in background tasks (#2326) * handle exceptions for background task * revert changes that is not related to this HTTP handler exception * Refactor model GoogleGenerativeAIModel (#2251) * refactor model GoogleGenerativeAIModel * adds model options --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> --------- Co-authored-by: ming luo <itestmycode@gmail.com> Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com> * Update GitHub Actions workflows and dependencies (#2341) * chore: Add GitHub Actions workflow for testing documentation build * Fix server start command in GitHub Actions workflows * chore: Bump langflow and langflow-base versions * chore: Update GitHub Actions workflow for docs_test * chore: Update typing import in __main__.py * Fix user authentication and authorization issues (#2343) --------- Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com> Co-authored-by: anovazzi1 <otavio2204@gmail.com> Co-authored-by: ming luo <itestmycode@gmail.com> Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
183 lines
No EOL
6.3 KiB
YAML
183 lines
No EOL
6.3 KiB
YAML
name: Langflow Release
|
|
run-name: Langflow Release by @${{ github.actor }}
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_package:
|
|
description: "Release package"
|
|
required: true
|
|
type: boolean
|
|
default: false
|
|
pre_release:
|
|
description: "Pre-release"
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
branch:
|
|
description: "Branch to release from"
|
|
required: true
|
|
type: string
|
|
default: "main"
|
|
|
|
env:
|
|
POETRY_VERSION: "1.8.2"
|
|
|
|
jobs:
|
|
release-base:
|
|
name: Release Langflow Base
|
|
if: inputs.release_package == true
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.check-version.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install poetry
|
|
run: pipx install poetry==${{ env.POETRY_VERSION }}
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.10"
|
|
cache: "poetry"
|
|
- name: Set up Nodejs 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
- name: Check Version
|
|
id: check-version
|
|
run: |
|
|
version=$(cd src/backend/base && poetry version --short)
|
|
last_released_version=$(curl -s "https://pypi.org/pypi/langflow-base/json" | jq -r '.releases | keys | .[]' | sort -V | tail -n 1)
|
|
if [ "$version" = "$last_released_version" ]; then
|
|
echo "Version $version is already released. Skipping release."
|
|
exit 1
|
|
else
|
|
echo version=$version >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Build project for distribution
|
|
run: make build base=true
|
|
- name: Test CLI
|
|
run: |
|
|
python -m pip install src/backend/base/dist/*.whl
|
|
python -m langflow run --host 127.0.0.1 --port 7860 &
|
|
SERVER_PID=$!
|
|
# Wait for the server to start
|
|
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/auto_login do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
|
|
# Terminate the server
|
|
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
|
|
sleep 10 # give the server some time to terminate
|
|
# Check if the server is still running
|
|
if kill -0 $SERVER_PID 2>/dev/null; then
|
|
echo "Failed to terminate the server"
|
|
exit 1
|
|
else
|
|
echo "Server terminated successfully"
|
|
fi
|
|
- name: Publish to PyPI
|
|
env:
|
|
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
|
|
run: make publish base=true
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist-base
|
|
path: src/backend/base/dist
|
|
|
|
release-main:
|
|
name: Release Langflow Main
|
|
if: inputs.release_package == true
|
|
needs: release-base
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.check-version.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install poetry
|
|
run: pipx install poetry==${{ env.POETRY_VERSION }}
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.10"
|
|
cache: "poetry"
|
|
- name: Set up Nodejs 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
- name: Check Version
|
|
id: check-version
|
|
run: |
|
|
version=$(poetry version --short)
|
|
last_released_version=$(curl -s "https://pypi.org/pypi/langflow/json" | jq -r '.releases | keys | .[]' | sort -V | tail -n 1)
|
|
if [ "$version" = "$last_released_version" ]; then
|
|
echo "Version $version is already released. Skipping release."
|
|
exit 1
|
|
else
|
|
echo version=$version >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Wait for PyPI Propagation
|
|
run: sleep 300 # wait for 5 minutes to ensure PyPI propagation
|
|
- name: Build project for distribution
|
|
run: make build main=true
|
|
- name: Test CLI
|
|
run: |
|
|
python -m pip install dist/*.whl
|
|
python -m langflow run --host 127.0.0.1 --port 7860 &
|
|
SERVER_PID=$!
|
|
# Wait for the server to start
|
|
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/auto_login; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
|
|
# Terminate the server
|
|
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
|
|
sleep 10 # give the server some time to terminate
|
|
# Check if the server is still running
|
|
if kill -0 $SERVER_PID 2>/dev/null; then
|
|
echo "Failed to terminate the server"
|
|
exit 1
|
|
else
|
|
echo "Server terminated successfully"
|
|
fi
|
|
- name: Publish to PyPI
|
|
env:
|
|
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
|
|
run: make publish main=true
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist-main
|
|
path: dist
|
|
|
|
call_docker_build:
|
|
name: Call Docker Build Workflow
|
|
needs: [release-base, release-main]
|
|
uses: langflow-ai/langflow/.github/workflows/docker-build.yml@main
|
|
strategy:
|
|
matrix:
|
|
release_type:
|
|
- base
|
|
- main
|
|
with:
|
|
# version should be needs.release-base.outputs.version if release_type is base
|
|
# version should be needs.release-main.outputs.version if release_type is main
|
|
version: ${{ matrix.release_type == 'base' && needs.release-base.outputs.version || matrix.release_type == 'main' && needs.release-main.outputs.version }}
|
|
release_type: ${{ matrix.release_type }}
|
|
pre_release: ${{ inputs.pre_release }}
|
|
secrets: inherit
|
|
|
|
create_release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
needs: release-main
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: dist-main
|
|
path: dist
|
|
- name: Create Release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
artifacts: "dist/*"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
draft: false
|
|
generateReleaseNotes: true
|
|
prerelease: ${{ inputs.pre_release }}
|
|
tag: v${{ needs.release-main.outputs.version }}
|
|
commit: ${{ inputs.branch }} |