🐳 feat: Publish Release-Matched Channel Gateway Images (#17784)

* feat: publish release-matched channel gateway images

* test: isolate compose configuration from service env files

* test: render channel compose in a complete isolated fixture

* fix: publish stable images from their release commit

* fix: omit gateway builds from releases predating channels
This commit is contained in:
Dustin Healy 2026-11-10 21:04:08 -08:00 • committed by GitHub
parent 0b1185b214
commit d269d35a2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 213 additions and 19 deletions

View file

@ -9,7 +9,14 @@ on:
- 'package-lock.json'
- 'scripts/typecheck.mts'
- '.dockerignore'
- 'docker-compose.yml'
- 'docker-compose.channels.yml'
- 'docker-compose.channels-build.yml'
- '.github/scripts/test-channel-compose.mjs'
- '.github/scripts/test-channel-release.mjs'
- '.github/workflows/tag-images.yml'
- '.github/workflows/main-image-workflow.yml'
- '.github/workflows/docker-publish.yml'
- 'docker-compose.mongo-replica.yml'
- 'utils/docker/init-replica.js'
- '.env.example'
@ -23,7 +30,14 @@ on:
- 'package-lock.json'
- 'scripts/typecheck.mts'
- '.dockerignore'
- 'docker-compose.yml'
- 'docker-compose.channels.yml'
- 'docker-compose.channels-build.yml'
- '.github/scripts/test-channel-compose.mjs'
- '.github/scripts/test-channel-release.mjs'
- '.github/workflows/tag-images.yml'
- '.github/workflows/main-image-workflow.yml'
- '.github/workflows/docker-publish.yml'
- 'docker-compose.mongo-replica.yml'
- 'utils/docker/init-replica.js'
- '.env.example'
@ -60,6 +74,10 @@ jobs:
run: npm run test:ci --workspace @librechat/channel-gateway
- name: Build gateway
run: npm run build --workspace @librechat/channel-gateway
- name: Verify release image provenance
run: node .github/scripts/test-channel-release.mjs
- name: Verify release and source Compose configuration
run: node .github/scripts/test-channel-compose.mjs
- name: Verify local replica conversion and restart
shell: bash
run: |

View file

@ -1,4 +1,4 @@
name: Docker Compose Build Latest Main Image Tag (Manual Dispatch)
name: Publish Latest Stable Release Images (Manual Dispatch)
on:
workflow_dispatch:
@ -16,6 +16,7 @@ jobs:
outputs:
latest_tag: ${{ steps.tag.outputs.latest_tag }}
sha: ${{ steps.tag.outputs.sha }}
images: ${{ steps.tag.outputs.images }}
steps:
- name: Checkout
uses: actions/checkout@v5
@ -36,24 +37,26 @@ jobs:
exit 1
fi
printf 'latest_tag=%s\n' "$LATEST_TAG" >> "$GITHUB_OUTPUT"
# Pin the publish to the commit this job resolved the tag from. `main`
# is a moving ref: were each build leg to resolve it independently, the
# amd64 and arm64 halves of one release could come from different
# commits and still be published under the same tags.
printf 'sha=%s\n' "$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
# A versioned artifact must build the selected release, even when main
# has advanced. Both architectures receive that immutable commit.
printf 'sha=%s\n' "$(git rev-parse "${LATEST_TAG}^{commit}")" >> "$GITHUB_OUTPUT"
images='[{"target":"api-build","file":"Dockerfile.multi","image_name":"librechat-api"},{"target":"node","file":"Dockerfile","image_name":"librechat"}'
# Older releases have no gateway; do not invent an artifact for them.
if git cat-file -e "${LATEST_TAG}:packages/channel-gateway/Dockerfile" 2>/dev/null; then
images+=',{"target":"runtime","file":"packages/channel-gateway/Dockerfile","image_name":"librechat-channel-gateway"}'
fi
printf 'images=%s]\n' "$images" >> "$GITHUB_OUTPUT"
publish:
needs: resolve-tag
uses: ./.github/workflows/docker-publish.yml
with:
images: >-
[{"target":"api-build","file":"Dockerfile.multi","image_name":"librechat-api"},
{"target":"node","file":"Dockerfile","image_name":"librechat"}]
images: ${{ needs.resolve-tag.outputs.images }}
tag_suffixes: |
${{ needs.resolve-tag.outputs.latest_tag }}
latest
checkout_ref: ${{ needs.resolve-tag.outputs.sha }}
build_branch: main
build_branch: ${{ needs.resolve-tag.outputs.latest_tag }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

View file

@ -67,7 +67,8 @@ jobs:
with:
images: >-
[{"target":"api-build","file":"Dockerfile.multi","image_name":"librechat-api"},
{"target":"node","file":"Dockerfile","image_name":"librechat"}]
{"target":"node","file":"Dockerfile","image_name":"librechat"},
{"target":"runtime","file":"packages/channel-gateway/Dockerfile","image_name":"librechat-channel-gateway"}]
tag_suffixes: ${{ needs.resolve-tags.outputs.tag_suffixes }}
build_branch: ${{ github.ref_name }}
secrets: