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
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.check-version.outputs.version }}
|
version: ${{ steps.check-version.outputs.version }}
|
||||||
|
skipped: ${{ steps.check-version.outputs.skipped }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install poetry
|
- 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)
|
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."
|
||||||
|
echo skipped=true >> $GITHUB_OUTPUT
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo version=$version >> $GITHUB_OUTPUT
|
echo version=$version >> $GITHUB_OUTPUT
|
||||||
|
echo skipped=false >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
- name: Build project for distribution
|
- name: Build project for distribution
|
||||||
|
if: steps.check-version.outputs.skipped == 'false'
|
||||||
run: make build base=true
|
run: make build base=true
|
||||||
- name: Test CLI
|
- name: Test CLI
|
||||||
|
if: steps.check-version.outputs.skipped == 'false'
|
||||||
run: |
|
run: |
|
||||||
python -m pip install src/backend/base/dist/*.whl
|
python -m pip install src/backend/base/dist/*.whl
|
||||||
python -m langflow run --host 127.0.0.1 --port 7860 &
|
python -m langflow run --host 127.0.0.1 --port 7860 &
|
||||||
|
|
@ -75,10 +80,12 @@ jobs:
|
||||||
echo "Server terminated successfully"
|
echo "Server terminated successfully"
|
||||||
fi
|
fi
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
|
if: steps.check-version.outputs.skipped == 'false'
|
||||||
env:
|
env:
|
||||||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
|
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
run: make publish base=true
|
run: make publish base=true
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
|
if: steps.check-version.outputs.skipped == 'false'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: dist-base
|
name: dist-base
|
||||||
|
|
@ -116,7 +123,9 @@ jobs:
|
||||||
echo version=$version >> $GITHUB_OUTPUT
|
echo version=$version >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
- name: Wait for PyPI Propagation
|
- name: Wait for PyPI Propagation
|
||||||
|
if: needs.release-base.outputs.skipped == 'false'
|
||||||
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
|
||||||
- name: Test CLI
|
- name: Test CLI
|
||||||
|
|
@ -125,7 +134,7 @@ jobs:
|
||||||
python -m langflow run --host 127.0.0.1 --port 7860 &
|
python -m langflow run --host 127.0.0.1 --port 7860 &
|
||||||
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/health_check; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
|
||||||
# Terminate the server
|
# Terminate the server
|
||||||
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
|
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
|
||||||
sleep 10 # give the server some time to terminate
|
sleep 10 # give the server some time to terminate
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue