Skip to content

Commit 27a8c09

Browse files
authored
ci(release): promote release images to Quay (#5807)
Release Dev and Publish Release now copy the SHA-tagged images from the CI registry (ghcr.io/<owner>/openshell) to quay.io/ai-openshell instead of retagging them in ghcr.io/nvidia/openshell. Stable archives are pushed to Quay directly. Jobs log in to Quay through the org's quay-login action with the job's OIDC token, so they run in the release environment. Dev also pushes the SHA tag so the 0.0.0-dev.<sha> chart resolves, and dev and prerelease promotions verify the SBOM on the Quay copy. Refs #4554 Signed-off-by: Simon Scatton <sscatton@nvidia.com>
1 parent 8560753 commit 27a8c09

2 files changed

Lines changed: 53 additions & 18 deletions

File tree

‎.github/workflows/release-dev.yml‎

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,26 +209,45 @@ jobs:
209209
checkout-ref: ${{ github.sha }}
210210

211211
tag-ghcr-dev:
212-
name: Tag GHCR Images as Dev
212+
name: Promote Dev Images to Quay
213213
needs: [build-images, release-dev]
214214
runs-on: ubuntu-24.04
215215
timeout-minutes: 10
216+
# Only jobs in this environment can trade their OIDC token for the Quay robot.
217+
environment: release
216218
permissions:
217-
packages: write
219+
contents: read
220+
id-token: write
221+
packages: read
218222
steps:
219-
- name: Log in to GHCR
223+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
224+
with:
225+
persist-credentials: false
226+
227+
- name: Log in to the CI registry
220228
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin
221229

222-
- name: Tag images as dev
230+
- name: Log in to Quay
231+
uses: ai-openshell/workflows/quay-login@96e33d5551ba4e706203648eb90710c48466e543 # main
232+
with:
233+
robot: ai-openshell+openshell_release
234+
clients: docker
235+
236+
# The SHA tag backs the 0.0.0-dev.<sha> chart, which pins appVersion to it.
237+
- name: Promote images as dev
238+
env:
239+
SOURCE_SHA: ${{ github.sha }}
223240
run: |
224241
set -euo pipefail
225-
REGISTRY="ghcr.io/ai-openshell/openshell"
242+
CI_REGISTRY="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/openshell"
226243
for component in gateway sandbox supervisor; do
227-
echo "Tagging ${REGISTRY}/${component}:${{ github.sha }} as dev..."
244+
echo "Promoting ${CI_REGISTRY}/${component}:${SOURCE_SHA} to quay.io/ai-openshell/${component}..."
228245
docker buildx imagetools create \
229246
--prefer-index=false \
230-
-t "${REGISTRY}/${component}:dev" \
231-
"${REGISTRY}/${component}:${{ github.sha }}"
247+
-t "quay.io/ai-openshell/${component}:${SOURCE_SHA}" \
248+
-t "quay.io/ai-openshell/${component}:dev" \
249+
"${CI_REGISTRY}/${component}:${SOURCE_SHA}"
250+
tasks/scripts/verify-image-sbom.sh "quay.io/ai-openshell/${component}:dev" --require-cargo
232251
done
233252
234253
build-deb:

‎.github/workflows/release-publish.yml‎

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,19 @@ jobs:
184184
if-no-files-found: error
185185

186186
tag-ghcr-release:
187-
name: Publish GHCR Images
187+
name: Publish Quay Images
188188
needs: assemble
189189
runs-on: ubuntu-24.04
190190
timeout-minutes: 10
191+
# Only jobs in this environment can trade their OIDC token for the Quay robot.
192+
environment: release
191193
permissions:
192194
actions: read
193195
contents: read
194-
packages: write
196+
id-token: write
197+
packages: read
195198
steps:
196199
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
197-
if: ${{ !inputs.is-prerelease }}
198200
with:
199201
persist-credentials: false
200202
ref: ${{ inputs.source-sha }}
@@ -210,17 +212,24 @@ jobs:
210212
path: artifacts/
211213
merge-multiple: true
212214

213-
- name: Log in to GHCR
215+
- name: Log in to the CI registry
216+
if: ${{ inputs.is-prerelease }}
214217
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin
215218

219+
- name: Log in to Quay
220+
uses: ai-openshell/workflows/quay-login@96e33d5551ba4e706203648eb90710c48466e543 # main
221+
with:
222+
robot: ai-openshell+openshell_release
223+
clients: docker
224+
216225
- name: Publish stable image archives
217226
if: ${{ !inputs.is-prerelease }}
218227
env:
219228
VERSION: ${{ inputs.semver }}
220229
run: |
221230
set -euo pipefail
222231
for component in gateway sandbox supervisor; do
223-
image="ghcr.io/nvidia/openshell/${component}:${VERSION}"
232+
image="quay.io/ai-openshell/${component}:${VERSION}"
224233
# Never replace a published stable image; a rerun keeps the original.
225234
# Only a missing manifest means unpublished; any other lookup error
226235
# fails rather than risk overwriting.
@@ -264,21 +273,28 @@ jobs:
264273
VERSION: ${{ inputs.semver }}
265274
run: |
266275
set -euo pipefail
267-
REGISTRY="ghcr.io/nvidia/openshell"
276+
REGISTRY="quay.io/ai-openshell"
277+
# Prereleases promote the SHA-tagged build from the CI registry;
278+
# stable images were already published to Quay above.
279+
SOURCE_REGISTRY="${REGISTRY}"
280+
if [[ "${IS_PRERELEASE}" == "true" ]]; then
281+
SOURCE_REGISTRY="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/openshell"
282+
fi
268283
for component in gateway sandbox supervisor; do
269284
if [[ "${IS_PRERELEASE}" == "true" ]]; then
270-
echo "Tagging ${REGISTRY}/${component}:${SOURCE_TAG} as ${VERSION}..."
285+
echo "Promoting ${SOURCE_REGISTRY}/${component}:${SOURCE_TAG} as ${REGISTRY}/${component}:${VERSION}..."
271286
docker buildx imagetools create \
272287
--prefer-index=false \
273288
-t "${REGISTRY}/${component}:${VERSION}" \
274-
"${REGISTRY}/${component}:${SOURCE_TAG}"
289+
"${SOURCE_REGISTRY}/${component}:${SOURCE_TAG}"
290+
tasks/scripts/verify-image-sbom.sh "${REGISTRY}/${component}:${VERSION}" --require-cargo
275291
fi
276292
if [[ "${MAKE_LATEST}" == "true" ]]; then
277-
echo "Tagging ${REGISTRY}/${component}:${SOURCE_TAG} as latest..."
293+
echo "Tagging ${SOURCE_REGISTRY}/${component}:${SOURCE_TAG} as latest..."
278294
docker buildx imagetools create \
279295
--prefer-index=false \
280296
-t "${REGISTRY}/${component}:latest" \
281-
"${REGISTRY}/${component}:${SOURCE_TAG}"
297+
"${SOURCE_REGISTRY}/${component}:${SOURCE_TAG}"
282298
fi
283299
done
284300

0 commit comments

Comments
 (0)