From 6f423f85cf4615717e4f6a81e925b005dd106a41 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Fri, 11 Jul 2025 12:53:08 +0200 Subject: [PATCH] Fix github storage consistency Signed-off-by: Bryan Frimin --- .github/workflows/release.yaml | 51 ++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5b52c01a0..7771531f1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -98,22 +98,51 @@ jobs: - name: Get image digest id: image run: | - # Get the digest from the registry using docker buildx imagetools - # Use Descriptor.Digest for manifest lists (multi-platform images) - DIGEST=$(docker buildx imagetools inspect ghcr.io/getprobo/probo:${{ github.ref_name }} --format '{{.Descriptor.Digest}}' 2>/dev/null || echo "") + # Wait for the multi-platform manifest to be available + echo "Waiting for multi-platform manifest to be available..." + for i in {1..30}; do + echo "Attempt $i/30: Checking if image is available..." + + # Try to get the digest from the registry + DIGEST=$(docker buildx imagetools inspect ghcr.io/getprobo/probo:${{ github.ref_name }} --format '{{.Descriptor.Digest}}' 2>/dev/null || echo "") + + if [ -n "$DIGEST" ]; then + echo "Successfully retrieved digest: $DIGEST" + echo "digest=$DIGEST" >> "$GITHUB_OUTPUT" + exit 0 + fi + + echo "Image not available yet, waiting 10 seconds..." + sleep 10 + done - if [ -z "$DIGEST" ]; then - echo "Failed to get digest from registry, trying alternative method..." - # Alternative: use the latest tag if version-specific tag fails - DIGEST=$(docker buildx imagetools inspect ghcr.io/getprobo/probo:latest --format '{{.Descriptor.Digest}}' 2>/dev/null || echo "") + # If we get here, the primary method failed, try alternative approaches + echo "Primary method failed, trying alternative methods..." + + # Try inspecting the latest tag + echo "Trying latest tag..." + DIGEST=$(docker buildx imagetools inspect ghcr.io/getprobo/probo:latest --format '{{.Descriptor.Digest}}' 2>/dev/null || echo "") + + if [ -n "$DIGEST" ]; then + echo "Successfully retrieved digest from latest tag: $DIGEST" + echo "digest=$DIGEST" >> "$GITHUB_OUTPUT" + exit 0 fi - if [ -z "$DIGEST" ]; then - echo "Error: Could not retrieve image digest from registry" - exit 1 + # Try getting digest from individual architecture images + echo "Trying to get digest from amd64 image..." + DIGEST_AMD64=$(docker buildx imagetools inspect ghcr.io/getprobo/probo:${{ github.ref_name }}-amd64 --format '{{.Descriptor.Digest}}' 2>/dev/null || echo "") + + if [ -n "$DIGEST_AMD64" ]; then + echo "Using amd64 image digest: $DIGEST_AMD64" + echo "digest=$DIGEST_AMD64" >> "$GITHUB_OUTPUT" + exit 0 fi - echo "digest=$DIGEST" >> "$GITHUB_OUTPUT" + echo "Error: Could not retrieve image digest from registry after all attempts" + echo "Available tags for debugging:" + docker buildx imagetools inspect ghcr.io/getprobo/probo --format '{{json .}}' 2>/dev/null || echo "Failed to inspect repository" + exit 1 - name: Attest Docker image SBOM uses: actions/attest-sbom@v1