From 3b012e0f35bf38690d86ac2ffd8cfa21c322d227 Mon Sep 17 00:00:00 2001 From: "bo.jiang" Date: Fri, 17 Nov 2023 10:15:33 +0800 Subject: [PATCH] fix upload assets greater than 2 GiB issue Signed-off-by: bo.jiang --- .github/workflows/call-build-imgs-for-spray.yaml | 7 +++---- .github/workflows/call-offline-build.yaml | 5 ++++- artifacts/generate_offline_package.sh | 5 +---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/call-build-imgs-for-spray.yaml b/.github/workflows/call-build-imgs-for-spray.yaml index d496d437f..f74297191 100644 --- a/.github/workflows/call-build-imgs-for-spray.yaml +++ b/.github/workflows/call-build-imgs-for-spray.yaml @@ -46,13 +46,12 @@ jobs: - name: Checks if a image with the same tag exists id: check run: | + echo "need_rebuild=true" >>$GITHUB_OUTPUT commit_short_sha=${{ needs.output-variable.outputs.image_tag_short_sha }} - ghcr_token=$(curl https://ghcr.io/token\?scope\="repository:kubean-io/kubespray:pull" | jq '.token' | tr -d '"') - curl -H "Authorization: Bearer ${ghcr_token}" https://ghcr.io/v2/kubean-io/kubespray/tags/list | jq '.tags' | tr -d '[",]' > tags + ghcr_token=$(curl https://ghcr.io/token\?scope\="repository:${{ inputs.REPO }}/kubespray:pull" | jq '.token' | tr -d '"') + curl -H "Authorization: Bearer ${ghcr_token}" https://ghcr.io/v2/${{ inputs.REPO }}/kubespray/tags/list | jq '.tags' | tr -d '[",]' > tags if grep -q ${commit_short_sha} tags; then echo "need_rebuild=false" >>$GITHUB_OUTPUT - else - echo "need_rebuild=true" >>$GITHUB_OUTPUT fi - uses: actions/checkout@v3 diff --git a/.github/workflows/call-offline-build.yaml b/.github/workflows/call-offline-build.yaml index 16595b507..67e6da83c 100644 --- a/.github/workflows/call-offline-build.yaml +++ b/.github/workflows/call-offline-build.yaml @@ -15,7 +15,7 @@ jobs: - name: Set kubespray version env run: | echo "SPRAY_VERSION=$(yq ".kubespray_version" version.yml)" >> ${GITHUB_ENV} - echo "KUBE_VERSION=$(yq ".kubernetes_version" version.yml)" >> ${GITHUB_ENV} + echo "KUBE_VERSION=$(yq ".kubernetes_version" version.yml)" >> ${GITHUB_ENV} - name: Git clone kubespray repo uses: actions/checkout@v3 @@ -84,6 +84,9 @@ jobs: mv images.list images-${ARCH}.list cd ../../ tree ${KUBEAN_TAG}/ + echo -e "\noutput files size:\n" + ls -lh ${KUBEAN_TAG}/amd64/ + ls -lh ${KUBEAN_TAG}/arm64/ - name: Release and upload packages if: startsWith(github.ref, 'refs/tags/') diff --git a/artifacts/generate_offline_package.sh b/artifacts/generate_offline_package.sh index 7dac49201..022f0e17c 100644 --- a/artifacts/generate_offline_package.sh +++ b/artifacts/generate_offline_package.sh @@ -140,10 +140,7 @@ function create_images() { local images_list_content images_list_content=$(cat "${CURRENT_DIR}/kubespray/contrib/offline/temp/images.list") - if [ ! -d "offline-images" ]; then - echo "create offline-images directory." - mkdir offline-images - fi + rm -rf offline-images && mkdir offline-images while read -r image_name; do echo "download image $image_name to local"