mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 02:53:30 +00:00
Update GH action so it correctly queries for test.pypi, etc. (#875)
The previous curl command was wrong and did not actually check for version correctly (status code was always 200 regardless of what you retrieved.) Also added tagging latest. cc @wukaixingxp
This commit is contained in:
parent
2cebb24d3a
commit
d111bad2f2
1 changed files with 12 additions and 2 deletions
14
.github/workflows/publish-to-docker.yml
vendored
14
.github/workflows/publish-to-docker.yml
vendored
|
@ -46,8 +46,11 @@ jobs:
|
|||
# Function to check if version exists in a repository
|
||||
check_version() {
|
||||
local repo=$1
|
||||
local status_code=$(curl -s -o /dev/null -w "%{http_code}" "https://$repo.org/project/llama-stack/${{ steps.version.outputs.version }}")
|
||||
return $([ "$status_code" -eq 200 ])
|
||||
local VERSION_TO_CHECK=${{ steps.version.outputs.version }}
|
||||
echo "Checking version $VERSION_TO_CHECK in $repo"
|
||||
result=$(curl -s "https://$repo.org/pypi/llama-stack/json" | jq --arg v "$VERSION_TO_CHECK" '.releases | has($v)')
|
||||
echo "Result: $result"
|
||||
return $([ "$result" = "true" ])
|
||||
}
|
||||
|
||||
# Check TestPyPI first, then PyPI
|
||||
|
@ -64,6 +67,7 @@ jobs:
|
|||
|
||||
- name: Install llama-stack
|
||||
run: |
|
||||
echo "PYPI_SOURCE=${PYPI_SOURCE}"
|
||||
if [ "${{ github.event_name }}" = "push" ]; then
|
||||
pip install -e .
|
||||
else
|
||||
|
@ -76,6 +80,8 @@ jobs:
|
|||
|
||||
- name: Build docker image
|
||||
run: |
|
||||
echo "PYPI_SOURCE=${PYPI_SOURCE}"
|
||||
echo "VERSION=${{ steps.version.outputs.version }}"
|
||||
TEMPLATES=("ollama" "bedrock" "remote-vllm" "fireworks" "together" "tgi" "meta-reference-gpu")
|
||||
for template in "${TEMPLATES[@]}"; do
|
||||
if [ "$PYPI_SOURCE" = "testpypi" ]; then
|
||||
|
@ -126,6 +132,8 @@ jobs:
|
|||
|
||||
- name: Push to dockerhub
|
||||
run: |
|
||||
echo "PYPI_SOURCE=${PYPI_SOURCE}"
|
||||
echo "VERSION=${{ steps.version.outputs.version }}"
|
||||
TEMPLATES=("ollama" "bedrock" "remote-vllm" "fireworks" "together" "tgi" "meta-reference-gpu")
|
||||
for template in "${TEMPLATES[@]}"; do
|
||||
if [ "$PYPI_SOURCE" = "testpypi" ]; then
|
||||
|
@ -133,6 +141,8 @@ jobs:
|
|||
docker push llamastack/distribution-$template:test-${{ steps.version.outputs.version }}
|
||||
else
|
||||
docker tag distribution-$template:${{ steps.version.outputs.version }} llamastack/distribution-$template:${{ steps.version.outputs.version }}
|
||||
docker tag distribution-$template:${{ steps.version.outputs.version }} llamastack/distribution-$template:latest
|
||||
docker push llamastack/distribution-$template:${{ steps.version.outputs.version }}
|
||||
docker push llamastack/distribution-$template:latest
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue