Skip to content

Commit 7135ad9

Browse files
authored
fix: promote images from :latest so unchanged images get the release version (#90)
1 parent d31ef27 commit 7135ad9

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ jobs:
4343
id-token: write
4444

4545
promote-images:
46-
# Tag every built image with the release's semantic version, by promoting the
47-
# already-tested :<sha> image (no rebuild). One version for the whole platform.
46+
# Tag every custom image with the release's semantic version, by retagging its
47+
# current :latest (no rebuild). One version for the whole platform — unchanged
48+
# images get their existing digest aliased under the new version too.
4849
name: Promote images to ${{ needs.release.outputs.version }}
4950
needs: release
5051
if: needs.release.outputs.released == 'true'
@@ -74,13 +75,16 @@ jobs:
7475
username: ${{ github.actor }}
7576
password: ${{ secrets.GITHUB_TOKEN }}
7677

77-
- name: Promote each image :sha -> :version
78-
# GITHUB_SHA is the released code (the release commit only bumps version/
79-
# changelog), and build.yml already pushed its :<sha> image.
78+
- name: Promote each image :latest -> :version
79+
# Retag every image's current :latest (its most-recent main build, whether
80+
# or not it changed this cycle) with the release version. Server-side
81+
# manifest retag — no rebuild, no layer push. Using :latest (not :<sha>)
82+
# means unchanged images, which were never built at the release commit,
83+
# still get tagged — so the whole platform ends up on one version.
8084
run: |
8185
set -euo pipefail
8286
for image in $(uv run ci images .); do
8387
repo="${REGISTRY}/${REGISTRY_NAMESPACE}/${image}"
84-
docker buildx imagetools create "${repo}:${GITHUB_SHA}" --tag "${repo}:${VERSION}"
85-
echo "Promoted \`${repo}:${VERSION}\` (from \`:${GITHUB_SHA}\`)." >> "$GITHUB_STEP_SUMMARY"
88+
docker buildx imagetools create "${repo}:latest" --tag "${repo}:${VERSION}"
89+
echo "Promoted \`${repo}:${VERSION}\` (from \`:latest\`)." >> "$GITHUB_STEP_SUMMARY"
8690
done

0 commit comments

Comments
 (0)