From 54b0734ef4ec761792dc631db0b0cd61690137dd Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 13 Aug 2026 00:31:48 -0500 Subject: [PATCH] chore: add GITHUB_TOKEN environment variable to setup task in multiple workflows --- .../actions/setup-dev-environment/action.yml | 2 + .github/workflows/build-linux-packages.yml | 2 + .github/workflows/build-release.yml | 2 + .github/workflows/ci.yml | 2 + meshchatx.rsm | Bin 188643 -> 188643 bytes scripts/ci/docker-build-entry.sh | 9 +---- scripts/ci/setup-task.sh | 37 +++++++++++++++++- 7 files changed, 44 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-dev-environment/action.yml b/.github/actions/setup-dev-environment/action.yml index e6ef044d..9cd3c729 100644 --- a/.github/actions/setup-dev-environment/action.yml +++ b/.github/actions/setup-dev-environment/action.yml @@ -105,4 +105,6 @@ runs: - name: Setup Task if: inputs.install-task == 'true' shell: bash + env: + GITHUB_TOKEN: ${{ github.token }} run: sh scripts/ci/setup-task.sh "${{ inputs.task-version }}" diff --git a/.github/workflows/build-linux-packages.yml b/.github/workflows/build-linux-packages.yml index c517f60f..6492050f 100644 --- a/.github/workflows/build-linux-packages.yml +++ b/.github/workflows/build-linux-packages.yml @@ -95,6 +95,8 @@ jobs: artifact-name: ${{ env.FRONTEND_ARTIFACT_NAME }} - name: Setup Task + env: + GITHUB_TOKEN: ${{ github.token }} run: sh scripts/ci/setup-task.sh - name: Build release-assets diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 34bccc8f..7281836f 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -130,6 +130,8 @@ jobs: - name: Setup Task if: matrix.setup_trivy + env: + GITHUB_TOKEN: ${{ github.token }} run: sh scripts/ci/setup-task.sh - name: Apt update (for Trivy .deb) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb4a9c2e..489cd71b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,6 +120,8 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Setup Task + env: + GITHUB_TOKEN: ${{ github.token }} run: sh scripts/ci/setup-task.sh 3.49.1 - name: Run visualiser-wasm tests diff --git a/meshchatx.rsm b/meshchatx.rsm index cd46ba35882f91fd32927dbd23cfd8e74d8a2e13..822e22721e664b95575f4688988c1a63f05376c6 100644 GIT binary patch delta 563 zcmXYtKWNiI6o5&DC>956#bi)|gKm27z56Q&zv^0@T-Ayn0jr^3?wPSpNgPwZ)556$g==S4oDDBnYnp z=jbh)K-sWGpF8!`JpyIk~7ad22NzO9H8+105u&a)nZ6 zr4?iqm5n}1<7D(f36rHl=SA$bk4*J8o2?2VIVB?jqJ|JCMi9)Fbz~(4qOu_gFWD)? zOsd#GbRp=Fq9}0tAJmwcOP%EB)2XGao&9VLqYoHlvcfrtNZL}d)yjKcC?z)opPyOkX$Ifq#KG1(YMBuSCjB$rW>lz^-QqEjJe;baD~ zHk$;-aM>Ond|BH)P_cCha*^R&GJuuHnXO0gq@yBRK9CJ4O-WJFGR9af8Oa+FL!^9f MdQclq59)pV2ZM^WO#lD@ delta 563 zcmXYtJ7|)JDNnsTfg;g5~B1A~AGL=mTYGn|FRD%A3)v3HC8j$UlC$%vtZCOOE_ zr076OK$J{g#17g|8$VlBVjV;6Uc3Nn=Pgh$#xYT?YOVD-kW*Yrv<6E;ufS3f;wZsH P9qvplH3kz)JNo)By|K31 diff --git a/scripts/ci/docker-build-entry.sh b/scripts/ci/docker-build-entry.sh index 5402c1f7..b55a50fc 100755 --- a/scripts/ci/docker-build-entry.sh +++ b/scripts/ci/docker-build-entry.sh @@ -26,14 +26,7 @@ if ! command -v node >/dev/null 2>&1; then apt-get install -y nodejs fi -TASK_VER="${TASK_VERSION:-3.46.4}" -_TASK_ARCH="$(uname -m)" -case "$_TASK_ARCH" in - x86_64) _TASK_ARCH="amd64" ;; - aarch64) _TASK_ARCH="arm64" ;; -esac -curl -fsSL "https://github.com/go-task/task/releases/download/v${TASK_VER}/task_linux_${_TASK_ARCH}.tar.gz" \ - | tar xz -C /usr/local/bin task +sh scripts/ci/setup-task.sh "${TASK_VERSION:-3.49.1}" corepack enable corepack prepare "pnpm@${PNPM_VERSION}" --activate diff --git a/scripts/ci/setup-task.sh b/scripts/ci/setup-task.sh index 69303283..bff294e9 100755 --- a/scripts/ci/setup-task.sh +++ b/scripts/ci/setup-task.sh @@ -19,9 +19,42 @@ esac BASE_URL="https://github.com/go-task/task/releases/download/v${TASK_VERSION}" TARBALL="task_linux_${ARCH}.tar.gz" +# GitHub release CDN over HTTP/2 can drop the stream (curl 56, "tried 5 times"). +# Default curl --retry skips that recv error. HTTP/1.1 plus --retry-all-errors +# recovers from 503 and dropped connections. GITHUB_TOKEN / GH_TOKEN avoids +# unauthenticated github.com rate limits. -L strips Authorization on the +# objects.githubusercontent.com redirect. +download_release() { + dest="$1" + url="$2" + token="${GITHUB_TOKEN:-${GH_TOKEN:-}}" + if [ -n "$token" ]; then + curl -fsSL --http1.1 \ + --retry 8 \ + --retry-all-errors \ + --retry-delay 4 \ + --retry-max-time 180 \ + --connect-timeout 20 \ + --max-time 180 \ + -H "Authorization: Bearer ${token}" \ + -o "$dest" \ + "$url" + else + curl -fsSL --http1.1 \ + --retry 8 \ + --retry-all-errors \ + --retry-delay 4 \ + --retry-max-time 180 \ + --connect-timeout 20 \ + --max-time 180 \ + -o "$dest" \ + "$url" + fi +} + echo "Installing Task v${TASK_VERSION} (${ARCH})" -curl -fsSL "${BASE_URL}/task_checksums.txt" -o /tmp/task-checksums.txt -curl -fsSL "${BASE_URL}/${TARBALL}" -o /tmp/task.tar.gz +download_release /tmp/task-checksums.txt "${BASE_URL}/task_checksums.txt" +download_release /tmp/task.tar.gz "${BASE_URL}/${TARBALL}" EXPECTED="$(grep " ${TARBALL}\$" /tmp/task-checksums.txt | cut -d' ' -f1)" ACTUAL="$(sha256sum /tmp/task.tar.gz | cut -d' ' -f1)"