Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix release workflows for uv #4053

Merged
merged 11 commits into from
Oct 7, 2024
Next Next commit
Release workflow fixes
  • Loading branch information
jordanrfrazier committed Oct 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 9642dc10a3c28a9de73592257ac445464f9daa34
36 changes: 14 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ on:
type: boolean
default: true

env:
POETRY_VERSION: "1.8.2"

jobs:
ci:
Expand All @@ -59,15 +57,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Environment
uses: ./.github/workflows/setup-uv.yml
uses: ./.github/actions/setup-uv
with:
ref: ${{ github.ref }}
- name: Install the project
run: uv sync --dev
- name: Check Version
id: check-version
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)
if [ "$version" = "$last_released_version" ]; then
echo "Version $version is already released. Skipping release."
Expand All @@ -83,8 +81,8 @@ jobs:
- name: Test CLI
if: steps.check-version.outputs.skipped == 'false'
run: |
python -m pip install src/backend/base/dist/*.whl
python -m langflow run --host 127.0.0.1 --port 7860 &
uv run python -m pip install src/backend/base/dist/*.whl
uv run python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
SERVER_PID=$!
# 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)
Expand All @@ -100,7 +98,7 @@ jobs:
fi
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
make publish base=true
- name: Upload Artifact
Expand All @@ -121,7 +119,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Environment
uses: ./.github/workflows/setup-uv.yml
uses: ./.github/actions/setup-uv
with:
ref: ${{ github.ref }}
- name: Install the project
Expand Down Expand Up @@ -158,8 +156,8 @@ jobs:
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 --backend-only &
uv pip install dist/*.whl
uv run python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
SERVER_PID=$!
# 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)
Expand Down Expand Up @@ -187,32 +185,26 @@ jobs:
call_docker_build_base:
name: Call Docker Build Workflow for Langflow Base
if: inputs.build_docker_base == true
needs: release-base
uses: ./.github/workflows/docker-build.yml
strategy:
matrix:
release_type:
- base
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: ""
release_type: ${{ matrix.release_type }}
version: ${{ needs.release-base.outputs.version }}
release_type: base
pre_release: ${{ inputs.pre_release }}
secrets: inherit

call_docker_build_main:
name: Call Docker Build Workflow for Langflow
if: inputs.build_docker_main == true
needs: release-main
uses: ./.github/workflows/docker-build.yml
strategy:
matrix:
release_type:
- 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: ""
release_type: ${{ matrix.release_type }}
version: ${{ needs.release-main.outputs.version }}
release_type: main
pre_release: ${{ inputs.pre_release }}
secrets: inherit

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,5 @@ jobs:
release_type: main
nightly_tag_main: ${{ inputs.nightly_tag_main }}
secrets: inherit