mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-06 10:37:22 +00:00
refactor: consolidate all client install logic into single action
Renamed install-client-for-release to install-llama-stack-client and made it handle both release branches and client-version inputs. Now all client installation logic lives in one place: - Release branches: always install from matching git branch - Non-release branches: install based on client-version input This eliminates all the conditional logic from setup-runner.
This commit is contained in:
parent
c86e6e906a
commit
626639beee
3 changed files with 29 additions and 29 deletions
51
.github/actions/install-llama-stack-client/action.yml
vendored
Normal file
51
.github/actions/install-llama-stack-client/action.yml
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
name: Install llama-stack-client
|
||||
description: Install llama-stack-client based on branch context and client-version input
|
||||
|
||||
inputs:
|
||||
client-version:
|
||||
description: 'Client version to install on non-release branches (latest or published). Ignored on release branches.'
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install llama-stack-client
|
||||
shell: bash
|
||||
run: |
|
||||
# Determine the branch we're working with
|
||||
# For PRs: use base_ref (target branch)
|
||||
# For pushes: use ref (current branch)
|
||||
BRANCH="${{ github.base_ref || github.ref }}"
|
||||
BRANCH="${BRANCH#refs/heads/}" # Strip refs/heads/ prefix
|
||||
|
||||
echo "Working with branch: $BRANCH"
|
||||
|
||||
# On release branches: always install from matching git branch to satisfy RC dependencies
|
||||
# On non-release branches: install based on client-version input
|
||||
if [[ "$BRANCH" =~ ^release-[0-9]+\.[0-9]+\.x$ ]]; then
|
||||
echo "Detected release branch: $BRANCH"
|
||||
echo "Checking if matching branch exists in llama-stack-client-python..."
|
||||
|
||||
# Check if the branch exists in the client repo
|
||||
if git ls-remote --exit-code --heads https://github.com/llamastack/llama-stack-client-python.git "$BRANCH" > /dev/null 2>&1; then
|
||||
echo "Installing llama-stack-client-python from matching branch: $BRANCH"
|
||||
uv pip install git+https://github.com/llamastack/llama-stack-client-python.git@$BRANCH
|
||||
else
|
||||
echo "::error::Branch $BRANCH not found in llama-stack-client-python repository"
|
||||
echo "::error::Please create the matching release branch in llama-stack-client-python before testing"
|
||||
exit 1
|
||||
fi
|
||||
elif [ -n "${{ inputs.client-version }}" ]; then
|
||||
# Non-release branch with client-version specified
|
||||
if [ "${{ inputs.client-version }}" = "latest" ]; then
|
||||
echo "Installing latest llama-stack-client-python from main branch"
|
||||
uv pip install git+https://github.com/llamastack/llama-stack-client-python.git@main
|
||||
elif [ "${{ inputs.client-version }}" = "published" ]; then
|
||||
echo "Installing published llama-stack-client-python from PyPI"
|
||||
uv pip install llama-stack-client
|
||||
else
|
||||
echo "Invalid client-version: ${{ inputs.client-version }}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue