Skip to content

Commit 388a9fd

Browse files
authored
chore: bump docker-model and llamacpp versions in build.json (#843)
* chore: bump docker-model and llamacpp versions in build.json * chore: update llamacpp version fetching logic in release workflow * chore: streamline release workflow by adding model-runner checkout and loading GO version conditionally
1 parent 03ec944 commit 388a9fd

1 file changed

Lines changed: 34 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -477,30 +477,50 @@ jobs:
477477
token: ${{ secrets.CLI_RELEASE_PAT }}
478478
fetch-depth: 0
479479

480-
- name: Bump docker-model version in build.json
480+
- name: Fetch latest llamacpp version from Docker Hub
481+
id: llamacpp
482+
run: |
483+
TAGS_JSON=$(curl -s "https://hub.docker.com/v2/repositories/docker/docker-model-backend-llamacpp/tags?page_size=25&ordering=last_updated")
484+
LLAMACPP_VERSION=$(echo "$TAGS_JSON" | jq -r '
485+
(.results[] | select(.name == "latest-cpu") | .digest) as $d |
486+
.results[] | select(.name != "latest-cpu" and (.name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-cpu$")) and .digest == $d) | .name | split("-")[0]
487+
')
488+
if [ -z "$LLAMACPP_VERSION" ] || [ "$LLAMACPP_VERSION" = "null" ]; then
489+
echo "::error::Failed to fetch latest llamacpp version from Docker Hub"
490+
exit 1
491+
fi
492+
echo "version=$LLAMACPP_VERSION" >> "$GITHUB_OUTPUT"
493+
echo "📦 Latest llamacpp version: $LLAMACPP_VERSION"
494+
495+
- name: Bump docker-model and llamacpp versions in build.json
481496
env:
482497
VERSION: ${{ needs.prepare.outputs.version }}
498+
LLAMACPP_VERSION: ${{ steps.llamacpp.outputs.version }}
483499
run: |
484500
NEW_VERSION="v${VERSION}"
485-
jq --arg v "$NEW_VERSION" '.["docker-model"].version = $v' build.json > build.json.tmp
501+
jq --arg model_v "$NEW_VERSION" --arg llama_v "$LLAMACPP_VERSION" '
502+
.["docker-model"].version = $model_v |
503+
.["llamacpp"].version = $llama_v
504+
' build.json > build.json.tmp
486505
mv build.json.tmp build.json
487506
488507
- name: Create pull request
489508
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
490509
with:
491510
token: ${{ secrets.CLI_RELEASE_PAT }}
492511
base: main
493-
commit-message: "chore: bump docker-model to v${{ needs.prepare.outputs.version }}"
512+
commit-message: "chore: bump docker-model to v${{ needs.prepare.outputs.version }} and llamacpp to ${{ steps.llamacpp.outputs.version }}"
494513
branch: bump-docker-model-v${{ needs.prepare.outputs.version }}
495-
title: "Bump docker-model to v${{ needs.prepare.outputs.version }}"
514+
title: "Bump docker-model to v${{ needs.prepare.outputs.version }} and llamacpp to ${{ steps.llamacpp.outputs.version }}"
496515
body: |
497516
### Ticket(s)
498517
499518
N/A — automated version bump
500519
501520
### What this PR does
502521
503-
Bumps docker-model version to v${{ needs.prepare.outputs.version }} in build.json.
522+
- Bumps docker-model version to v${{ needs.prepare.outputs.version }} in build.json.
523+
- Bumps llamacpp version to ${{ steps.llamacpp.outputs.version }} in build.json (latest from [Docker Hub](https://hub.docker.com/r/docker/docker-model-backend-llamacpp/tags)).
504524
505525
### Notes for the reviewer
506526
@@ -540,6 +560,15 @@ jobs:
540560
echo "changed=false" >> "$GITHUB_OUTPUT"
541561
fi
542562
563+
- name: Checkout model-runner
564+
if: steps.check-docs.outputs.changed == 'true'
565+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
566+
567+
- name: Load GO version
568+
if: steps.check-docs.outputs.changed == 'true'
569+
id: versions
570+
uses: ./.github/actions/load-go-version
571+
543572
- name: Checkout docs
544573
if: steps.check-docs.outputs.changed == 'true'
545574
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
@@ -548,10 +577,6 @@ jobs:
548577
token: ${{ secrets.CLI_RELEASE_PAT }}
549578
fetch-depth: 0
550579

551-
- name: Load GO version
552-
id: versions
553-
uses: ./.github/actions/load-go-version
554-
555580
- name: Set up Go
556581
if: steps.check-docs.outputs.changed == 'true'
557582
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c

0 commit comments

Comments
 (0)