From 6b2fcb61fdea95b7cbf90b02333708e5fd2b69a5 Mon Sep 17 00:00:00 2001 From: lilsus Date: Thu, 16 Jul 2026 06:13:56 +0300 Subject: [PATCH] ci: fix Hugo install to match runner arch (arm64/amd64 auto-detect) --- .gitea/workflows/deploy.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 85c38d8..7a6986a 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -76,10 +76,17 @@ jobs: - name: Install Hugo Extended run: | set -euo pipefail - HUGO_TARBALL="hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" + # Pick the tarball matching the runner CPU architecture (the runner + # image may be arm64, not amd64 — a mismatch gives "Exec format error"). + case "$(uname -m)" in + x86_64|amd64) HUGO_ARCH="linux-amd64" ;; + aarch64|arm64) HUGO_ARCH="linux-arm64" ;; + *) echo "unsupported arch: $(uname -m)"; exit 1 ;; + esac + HUGO_TARBALL="hugo_extended_${HUGO_VERSION}_${HUGO_ARCH}.tar.gz" URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_TARBALL}" - echo "Downloading $URL" - curl -sSL --retry 3 -o /tmp/hugo.tar.gz "$URL" + echo "Runner arch $(uname -m) -> downloading $URL" + curl -fsSL --retry 3 -o /tmp/hugo.tar.gz "$URL" mkdir -p "$(dirname "$HUGO_BIN")" tar -xzf /tmp/hugo.tar.gz -C "$(dirname "$HUGO_BIN")" hugo "$HUGO_BIN" version