瀏覽代碼

try to fix DOCKER_IMAGE_TAG in ghcr_push_runtime (od_runtime, arm64) (#3311)

tobitege 1 年之前
父節點
當前提交
5e6fd58f56
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      .github/workflows/ghcr.yml

+ 4 - 5
.github/workflows/ghcr.yml

@@ -305,7 +305,7 @@ jobs:
     needs: [ghcr_build_runtime, test_runtime, runtime_integration_tests_on_linux]
     if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
     env:
-      tags: ${{ needs.ghcr_build_runtime.outputs.tags }}
+      RUNTIME_TAGS: ${{ needs.ghcr_build_runtime.outputs.tags }}
     permissions:
       contents: read
       packages: write
@@ -349,16 +349,15 @@ jobs:
             exit 1
           fi
           echo "loaded image = $loaded_image"
-          tags=$(echo ${tags} | tr ' ' '\n')
           image_name=$(echo "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}" | tr '[:upper:]' '[:lower:]')
           echo "image name = $image_name"
-          for tag in $tags; do
+          echo "$RUNTIME_TAGS" | tr ' ' '\n' | while read -r tag; do
             echo "tag = $tag"
-            if [ -n "$image_name" ]; then
+            if [ -n "$image_name" ] && [ -n "$tag" ]; then
               docker tag $loaded_image $image_name:${tag}_${{ matrix.platform }}
               docker push $image_name:${tag}_${{ matrix.platform }}
             else
-              echo "Skipping tag and push due to empty image_name"
+              echo "Skipping tag and push due to empty image_name or tag"
             fi
           done