ci: add version check in workflow to skip jobs for unreleased versions of langflow-base (#3244)

feat: add version check in workflow to skip jobs for unreleased versions of langflow-base
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-08-08 12:04:36 -03:00 committed by GitHub
commit 4d1c8ad92a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,14 +69,30 @@ jobs:
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }}
- 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 has not been released yet. Skipping the rest of the job."
echo skipped=true >> $GITHUB_OUTPUT
exit 0
else
echo version=$version >> $GITHUB_OUTPUT
echo skipped=false >> $GITHUB_OUTPUT
fi
- name: Build wheel
if: steps.check-version.outputs.skipped == 'false'
run: |
poetry env use ${{ matrix.python-version }}
make build main=true
- name: Install wheel
if: steps.check-version.outputs.skipped == 'false'
run: |
python -m pip install dist/*.whl
- name: Test CLI
if: steps.check-version.outputs.skipped == 'false'
run: |
python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
SERVER_PID=$!