Skip to content

Commit

Permalink
Extract platform-specific-digests from manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghoriginal committed Mar 2, 2025
1 parent f10131b commit 2c50277
Showing 1 changed file with 44 additions and 8 deletions.
52 changes: 44 additions & 8 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,21 @@ jobs:
run: |
for component in $(echo '${{ env.QUERY_COMPONENTS }}' | jq -r '.[].name'); do
manifests=()
# Check and extract digest for amd64
if docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then
manifests+=("--amend ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64")
amd64_digest=$(docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64 | jq -r '.manifests[] | select(.platform.architecture == "amd64" and .platform.os == "linux") | .digest')
if [ -n "$amd64_digest" ]; then
manifests+=("${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64@$amd64_digest")
fi
fi
# Check and extract digest for arm64
if docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then
manifests+=("--amend ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64")
arm64_digest=$(docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64 | jq -r '.manifests[] | select(.platform.architecture == "arm64" and .platform.os == "linux") | .digest')
if [ -n "$arm64_digest" ]; then
manifests+=("${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64@$arm64_digest")
fi
fi
# Create and push the manifest list if there are manifests to combine
if [ ${#manifests[@]} -gt 0 ]; then
docker manifest create ${{ inputs.image_prefix }}/$component:${{ inputs.tag }} ${manifests[@]}
docker manifest push ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}
Expand Down Expand Up @@ -250,12 +259,21 @@ jobs:
run: |
for component in $(echo '${{ env.CONTROL_PLANE_COMPONENTS }}' | jq -r '.[].name'); do
manifests=()
# Check and extract digest for amd64
if docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then
manifests+=("--amend ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64")
amd64_digest=$(docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64 | jq -r '.manifests[] | select(.platform.architecture == "amd64" and .platform.os == "linux") | .digest')
if [ -n "$amd64_digest" ]; then
manifests+=("${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64@$amd64_digest")
fi
fi
# Check and extract digest for arm64
if docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then
manifests+=("--amend ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64")
arm64_digest=$(docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64 | jq -r '.manifests[] | select(.platform.architecture == "arm64" and .platform.os == "linux") | .digest')
if [ -n "$arm64_digest" ]; then
manifests+=("${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64@$arm64_digest")
fi
fi
# Create and push the manifest list if there are manifests to combine
if [ ${#manifests[@]} -gt 0 ]; then
docker manifest create ${{ inputs.image_prefix }}/$component:${{ inputs.tag }} ${manifests[@]}
docker manifest push ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}
Expand Down Expand Up @@ -328,12 +346,21 @@ jobs:
run: |
for component in $(echo '${{ env.SOURCES_COMPONENTS }}' | jq -r '.[].name'); do
manifests=()
# Check and extract digest for amd64
if docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then
manifests+=("--amend ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64")
amd64_digest=$(docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64 | jq -r '.manifests[] | select(.platform.architecture == "amd64" and .platform.os == "linux") | .digest')
if [ -n "$amd64_digest" ]; then
manifests+=("${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64@$amd64_digest")
fi
fi
# Check and extract digest for arm64
if docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then
manifests+=("--amend ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64")
arm64_digest=$(docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64 | jq -r '.manifests[] | select(.platform.architecture == "arm64" and .platform.os == "linux") | .digest')
if [ -n "$arm64_digest" ]; then
manifests+=("${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64@$arm64_digest")
fi
fi
# Create and push the manifest list if there are manifests to combine
if [ ${#manifests[@]} -gt 0 ]; then
docker manifest create ${{ inputs.image_prefix }}/$component:${{ inputs.tag }} ${manifests[@]}
docker manifest push ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}
Expand Down Expand Up @@ -406,12 +433,21 @@ jobs:
run: |
for component in $(echo '${{ env.REACTIONS_COMPONENTS }}' | jq -r '.[].name'); do
manifests=()
# Check and extract digest for amd64
if docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then
manifests+=("--amend ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64")
amd64_digest=$(docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64 | jq -r '.manifests[] | select(.platform.architecture == "amd64" and .platform.os == "linux") | .digest')
if [ -n "$amd64_digest" ]; then
manifests+=("${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-amd64@$amd64_digest")
fi
fi
# Check and extract digest for arm64
if docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then
manifests+=("--amend ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64")
arm64_digest=$(docker manifest inspect ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64 | jq -r '.manifests[] | select(.platform.architecture == "arm64" and .platform.os == "linux") | .digest')
if [ -n "$arm64_digest" ]; then
manifests+=("${{ inputs.image_prefix }}/$component:${{ inputs.tag }}-arm64@$arm64_digest")
fi
fi
# Create and push the manifest list if there are manifests to combine
if [ ${#manifests[@]} -gt 0 ]; then
docker manifest create ${{ inputs.image_prefix }}/$component:${{ inputs.tag }} ${manifests[@]}
docker manifest push ${{ inputs.image_prefix }}/$component:${{ inputs.tag }}
Expand Down

0 comments on commit 2c50277

Please sign in to comment.