ci: fix release workflows for uv (#4053)
This commit is contained in:
parent
7b3a8b829c
commit
4a574da0c0
10 changed files with 25 additions and 69 deletions
5
.github/actions/setup-uv/action.yml
vendored
5
.github/actions/setup-uv/action.yml
vendored
|
|
@ -1,10 +1,5 @@
|
||||||
name: "Setup uv"
|
name: "Setup uv"
|
||||||
description: "Checks out code, installs uv, and sets up Python environment"
|
description: "Checks out code, installs uv, and sets up Python environment"
|
||||||
inputs:
|
|
||||||
ref:
|
|
||||||
description: "Reference to check out"
|
|
||||||
required: false
|
|
||||||
default: "github.ref"
|
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
|
|
||||||
13
.github/workflows/docker-build.yml
vendored
13
.github/workflows/docker-build.yml
vendored
|
|
@ -103,9 +103,6 @@ jobs:
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
|
||||||
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev
|
run: uv sync --dev
|
||||||
|
|
||||||
|
|
@ -172,12 +169,10 @@ jobs:
|
||||||
- name: Check out the code at a specific ref
|
- name: Check out the code at a specific ref
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.ref }}
|
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
|
||||||
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -288,9 +283,9 @@ jobs:
|
||||||
|
|
||||||
restart-space:
|
restart-space:
|
||||||
name: Restart HuggingFace Spaces
|
name: Restart HuggingFace Spaces
|
||||||
if: ${{ inputs.release_type == 'main' && inputs.nightly_build == 'false' }}
|
if: ${{ inputs.release_type == 'main' && needs.get-version.outputs.nightly-build == 'false' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: [build, get-version]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version:
|
python-version:
|
||||||
|
|
@ -302,8 +297,6 @@ jobs:
|
||||||
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
|
||||||
|
|
||||||
- name: Restart HuggingFace Spaces Build
|
- name: Restart HuggingFace Spaces Build
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
2
.github/workflows/integration_tests.yml
vendored
2
.github/workflows/integration_tests.yml
vendored
|
|
@ -44,8 +44,6 @@ jobs:
|
||||||
ref: ${{ inputs.ref || github.ref }}
|
ref: ${{ inputs.ref || github.ref }}
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.ref || github.ref }}
|
|
||||||
- name: Run integration tests with api keys
|
- name: Run integration tests with api keys
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
2
.github/workflows/lint-py.yml
vendored
2
.github/workflows/lint-py.yml
vendored
|
|
@ -30,8 +30,6 @@ jobs:
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.branch || github.ref }}
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev
|
run: uv sync --dev
|
||||||
- name: Run Mypy
|
- name: Run Mypy
|
||||||
|
|
|
||||||
6
.github/workflows/nightly_build.yml
vendored
6
.github/workflows/nightly_build.yml
vendored
|
|
@ -30,8 +30,6 @@ jobs:
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ github.ref }}
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev
|
run: uv sync --dev
|
||||||
|
|
||||||
|
|
@ -76,10 +74,6 @@ jobs:
|
||||||
uv run ./scripts/ci/update_pyproject_name.py langflow-base-nightly base
|
uv run ./scripts/ci/update_pyproject_name.py langflow-base-nightly base
|
||||||
uv run ./scripts/ci/update_pyproject_version.py $BASE_TAG base
|
uv run ./scripts/ci/update_pyproject_version.py $BASE_TAG base
|
||||||
|
|
||||||
# This updates the dependency of langflow-base to langflow-base-nightly in {project_root}/pyproject.toml
|
|
||||||
# Note: Still necessary for poetry
|
|
||||||
uv run ./scripts/ci/update_lf_base_dependency.py $BASE_TAG
|
|
||||||
|
|
||||||
# Use the main tag created earlier
|
# Use the main tag created earlier
|
||||||
MAIN_TAG="${{ steps.generate_main_tag.outputs.main_tag }}"
|
MAIN_TAG="${{ steps.generate_main_tag.outputs.main_tag }}"
|
||||||
echo "Updating main project version to $MAIN_TAG"
|
echo "Updating main project version to $MAIN_TAG"
|
||||||
|
|
|
||||||
2
.github/workflows/python_test.yml
vendored
2
.github/workflows/python_test.yml
vendored
|
|
@ -119,8 +119,6 @@ jobs:
|
||||||
ref: ${{ inputs.ref || github.ref }}
|
ref: ${{ inputs.ref || github.ref }}
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.ref || github.ref }}
|
|
||||||
|
|
||||||
- name: Check Version
|
- name: Check Version
|
||||||
id: check-version
|
id: check-version
|
||||||
|
|
|
||||||
51
.github/workflows/release.yml
vendored
51
.github/workflows/release.yml
vendored
|
|
@ -35,8 +35,6 @@ on:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
|
|
||||||
env:
|
|
||||||
POETRY_VERSION: "1.8.2"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
|
|
@ -59,15 +57,13 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Setup Environment
|
- name: Setup Environment
|
||||||
uses: ./.github/workflows/setup-uv.yml
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ github.ref }}
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev
|
run: uv sync --dev
|
||||||
- name: Check Version
|
- name: Check Version
|
||||||
id: check-version
|
id: check-version
|
||||||
run: |
|
run: |
|
||||||
version=$(cd src/backend/base && poetry version --short)
|
version=$(uv tree | grep 'langflow-base' | awk '{print $3}')
|
||||||
last_released_version=$(curl -s "https://pypi.org/pypi/langflow-base/json" | jq -r '.releases | keys | .[]' | sort -V | tail -n 1)
|
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
|
if [ "$version" = "$last_released_version" ]; then
|
||||||
echo "Version $version is already released. Skipping release."
|
echo "Version $version is already released. Skipping release."
|
||||||
|
|
@ -79,12 +75,15 @@ jobs:
|
||||||
fi
|
fi
|
||||||
- name: Build project for distribution
|
- name: Build project for distribution
|
||||||
if: steps.check-version.outputs.skipped == 'false'
|
if: steps.check-version.outputs.skipped == 'false'
|
||||||
run: make build base=true
|
run: make build base=true args="--wheel"
|
||||||
- name: Test CLI
|
- name: Test CLI
|
||||||
if: steps.check-version.outputs.skipped == 'false'
|
if: steps.check-version.outputs.skipped == 'false'
|
||||||
run: |
|
run: |
|
||||||
python -m pip install src/backend/base/dist/*.whl
|
# TODO: Unsure why the whl is not built in src/backend/base/dist
|
||||||
python -m langflow run --host 127.0.0.1 --port 7860 &
|
mkdir src/backend/base/dist
|
||||||
|
mv dist/*.whl src/backend/base/dist
|
||||||
|
uv pip install src/backend/base/dist/*.whl
|
||||||
|
uv run python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
|
||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
# Wait for the server to start
|
# Wait for the server to start
|
||||||
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/api/v1/auto_login; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
|
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/api/v1/auto_login; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
|
||||||
|
|
@ -100,7 +99,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
env:
|
env:
|
||||||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
|
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
make publish base=true
|
make publish base=true
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
|
|
@ -121,9 +120,7 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Setup Environment
|
- name: Setup Environment
|
||||||
uses: ./.github/workflows/setup-uv.yml
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ github.ref }}
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev
|
run: uv sync --dev
|
||||||
|
|
||||||
|
|
@ -155,11 +152,11 @@ jobs:
|
||||||
run: sleep 300 # wait for 5 minutes to ensure PyPI propagation
|
run: sleep 300 # wait for 5 minutes to ensure PyPI propagation
|
||||||
|
|
||||||
- name: Build project for distribution
|
- name: Build project for distribution
|
||||||
run: make build main=true
|
run: make build main=true args="--no-sources --wheel"
|
||||||
- name: Test CLI
|
- name: Test CLI
|
||||||
run: |
|
run: |
|
||||||
python -m pip install dist/*.whl
|
uv pip install dist/*.whl
|
||||||
python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
|
uv run python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
|
||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
# Wait for the server to start
|
# Wait for the server to start
|
||||||
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/health_check; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
|
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/health_check; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
|
||||||
|
|
@ -187,32 +184,22 @@ jobs:
|
||||||
call_docker_build_base:
|
call_docker_build_base:
|
||||||
name: Call Docker Build Workflow for Langflow Base
|
name: Call Docker Build Workflow for Langflow Base
|
||||||
if: inputs.build_docker_base == true
|
if: inputs.build_docker_base == true
|
||||||
|
needs: release-base
|
||||||
uses: ./.github/workflows/docker-build.yml
|
uses: ./.github/workflows/docker-build.yml
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
release_type:
|
|
||||||
- base
|
|
||||||
with:
|
with:
|
||||||
# version should be needs.release-base.outputs.version if release_type is base
|
version: ${{ needs.release-base.outputs.version }}
|
||||||
# version should be needs.release-main.outputs.version if release_type is main
|
release_type: base
|
||||||
version: ""
|
|
||||||
release_type: ${{ matrix.release_type }}
|
|
||||||
pre_release: ${{ inputs.pre_release }}
|
pre_release: ${{ inputs.pre_release }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
call_docker_build_main:
|
call_docker_build_main:
|
||||||
name: Call Docker Build Workflow for Langflow
|
name: Call Docker Build Workflow for Langflow
|
||||||
if: inputs.build_docker_main == true
|
if: inputs.build_docker_main == true
|
||||||
|
needs: release-main
|
||||||
uses: ./.github/workflows/docker-build.yml
|
uses: ./.github/workflows/docker-build.yml
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
release_type:
|
|
||||||
- main
|
|
||||||
with:
|
with:
|
||||||
# version should be needs.release-base.outputs.version if release_type is base
|
version: ${{ needs.release-main.outputs.version }}
|
||||||
# version should be needs.release-main.outputs.version if release_type is main
|
release_type: main
|
||||||
version: ""
|
|
||||||
release_type: ${{ matrix.release_type }}
|
|
||||||
pre_release: ${{ inputs.pre_release }}
|
pre_release: ${{ inputs.pre_release }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
|
|
||||||
9
.github/workflows/release_nightly.yml
vendored
9
.github/workflows/release_nightly.yml
vendored
|
|
@ -64,8 +64,6 @@ jobs:
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.nightly_tag_main }}
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev
|
run: uv sync --dev
|
||||||
|
|
||||||
|
|
@ -91,8 +89,7 @@ jobs:
|
||||||
|
|
||||||
- name: Test CLI
|
- name: Test CLI
|
||||||
run: |
|
run: |
|
||||||
# TODO: unsure why the whl is not built in src/backend/base
|
# TODO: Unsure why the whl is not built in src/backend/base/dist
|
||||||
# uv pip install src/backend/base/dist/*.whl
|
|
||||||
mkdir src/backend/base/dist
|
mkdir src/backend/base/dist
|
||||||
mv dist/*.whl src/backend/base/dist/
|
mv dist/*.whl src/backend/base/dist/
|
||||||
uv pip install src/backend/base/dist/*.whl
|
uv pip install src/backend/base/dist/*.whl
|
||||||
|
|
@ -141,8 +138,6 @@ jobs:
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.nightly_tag_main }}
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev
|
run: uv sync --dev
|
||||||
|
|
||||||
|
|
@ -220,3 +215,5 @@ jobs:
|
||||||
release_type: main
|
release_type: main
|
||||||
nightly_tag_main: ${{ inputs.nightly_tag_main }}
|
nightly_tag_main: ${{ inputs.nightly_tag_main }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/style-check-py.yml
vendored
2
.github/workflows/style-check-py.yml
vendored
|
|
@ -21,8 +21,6 @@ jobs:
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ github.ref }}
|
|
||||||
- name: Register problem matcher
|
- name: Register problem matcher
|
||||||
run: echo "::add-matcher::.github/workflows/matchers/ruff.json"
|
run: echo "::add-matcher::.github/workflows/matchers/ruff.json"
|
||||||
- name: Run Ruff Check
|
- name: Run Ruff Check
|
||||||
|
|
|
||||||
2
.github/workflows/typescript_test.yml
vendored
2
.github/workflows/typescript_test.yml
vendored
|
|
@ -104,8 +104,6 @@ jobs:
|
||||||
|
|
||||||
- name: "Setup Environment"
|
- name: "Setup Environment"
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
with:
|
|
||||||
ref: ${{ inputs.ref || github.ref }}
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev
|
run: uv sync --dev
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue