ci: update workflow to skip publishing if package already exists (#3082)
fix: Update Makefile to skip publishing if package already exists
This commit is contained in:
parent
69c089a011
commit
410cd46c39
1 changed files with 10 additions and 1 deletions
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
|
|
@ -31,6 +31,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.check-version.outputs.version }}
|
||||
skipped: ${{ steps.check-version.outputs.skipped }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install poetry
|
||||
|
|
@ -51,13 +52,17 @@ jobs:
|
|||
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."
|
||||
echo skipped=true >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
else
|
||||
echo version=$version >> $GITHUB_OUTPUT
|
||||
echo skipped=false >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Build project for distribution
|
||||
if: steps.check-version.outputs.skipped == 'false'
|
||||
run: make build base=true
|
||||
- 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 &
|
||||
|
|
@ -75,10 +80,12 @@ jobs:
|
|||
echo "Server terminated successfully"
|
||||
fi
|
||||
- name: Publish to PyPI
|
||||
if: steps.check-version.outputs.skipped == 'false'
|
||||
env:
|
||||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
|
||||
run: make publish base=true
|
||||
- name: Upload Artifact
|
||||
if: steps.check-version.outputs.skipped == 'false'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist-base
|
||||
|
|
@ -116,7 +123,9 @@ jobs:
|
|||
echo version=$version >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Wait for PyPI Propagation
|
||||
if: needs.release-base.outputs.skipped == 'false'
|
||||
run: sleep 300 # wait for 5 minutes to ensure PyPI propagation
|
||||
|
||||
- name: Build project for distribution
|
||||
run: make build main=true
|
||||
- name: Test CLI
|
||||
|
|
@ -125,7 +134,7 @@ jobs:
|
|||
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/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/health_check; 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue