Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 30 additions & 23 deletions .github/workflows/cd-langchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ jobs:
with:
fetch-depth: 2

- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.27"
enable-cache: true

- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"

- name: Wait for uipath-llm-client publish
if: github.event_name == 'push'
env:
Expand All @@ -44,21 +55,26 @@ jobs:

case "$STATUS" in
completed:success)
echo "cd workflow succeeded — polling PyPI until uipath-llm-client==$CORE_VERSION is available..."
echo "cd workflow succeeded — verifying uv can resolve uipath-llm-client==$CORE_VERSION from PyPI..."
# Use uv itself as the readiness check (not curl). The setup-uv action
# restores uv's metadata cache across job runs, so the simple-index entry
# for uipath-llm-client may be stale (without the new version). Polling
# pypi.org/simple/ with curl proves only that PyPI knows about the version,
# not that uv will see it. --refresh-package invalidates uv's cache for
# this specific project and forces a fresh fetch each attempt. Retry rides
# out PyPI CDN propagation across Fastly edges (a fresh publish can be
# visible on one edge but stale on another for tens of seconds).
for j in $(seq 1 40); do
# Query the simple index directly with Cache-Control: no-cache so Fastly
# revalidates with origin on every request. PyPI purges the per-project
# simple page within seconds of a publish, so uv's local cache (max-age=600)
# would otherwise serve a stale miss for up to 10 minutes.
if curl -sf -H "Cache-Control: no-cache" \
"https://pypi.org/simple/uipath-llm-client/" | grep -q "$CORE_VERSION"; then
echo "uipath-llm-client==$CORE_VERSION is available on PyPI."
if uv pip install --dry-run --system --no-deps \
--refresh-package uipath-llm-client \
"uipath-llm-client==$CORE_VERSION" >/dev/null 2>&1; then
echo "uv can resolve uipath-llm-client==$CORE_VERSION from PyPI."
exit 0
fi
echo " Not yet available, retrying in 15s ($j/40)..."
echo " Not yet resolvable by uv, retrying in 15s ($j/40)..."
sleep 15
done
echo "::error::uipath-llm-client==$CORE_VERSION never appeared on PyPI (10 min)"
echo "::error::uipath-llm-client==$CORE_VERSION never became resolvable on PyPI (10 min)"
exit 1
;;
completed:*)
Expand All @@ -73,17 +89,6 @@ jobs:
echo "::error::Timed out waiting for cd workflow (15 min)"
exit 1

- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.27"
enable-cache: true

- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"

- name: "Install dependencies"
run: uv sync --dev --all-extras --locked

Expand All @@ -93,12 +98,14 @@ jobs:
- name: Smoke test (wheel with all extras)
run: |
WHEEL=$(ls dist/*.whl)
uv run --isolated --no-project --with "${WHEEL}[all]" tests/langchain/smoke_test.py
uv run --isolated --no-project --refresh-package uipath-llm-client \
--with "${WHEEL}[all]" tests/langchain/smoke_test.py

- name: Smoke test (source distribution with all extras)
run: |
SDIST=$(ls dist/*.tar.gz)
uv run --isolated --no-project --with "${SDIST}[all]" tests/langchain/smoke_test.py
uv run --isolated --no-project --refresh-package uipath-llm-client \
--with "${SDIST}[all]" tests/langchain/smoke_test.py

- name: Publish package
run: uv publish
Expand Down
Loading