diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index cfabd1a..e868875 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -25,12 +25,30 @@ jobs: # Ставим Node 20 из NodeSource repo. - name: Bootstrap Node 20 + git (для actions/checkout) run: | + set -e export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install -y --no-install-recommends curl git ca-certificates gnupg - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + # NodeSource setup может молча упасть на slow networks (особенно через VPN + # на u4-runner); retry + явная verification что Node >= 18 после install. + for i in 1 2 3; do + if curl -fsSL --retry 3 --retry-delay 5 --connect-timeout 30 \ + https://deb.nodesource.com/setup_20.x | bash -; then + break + fi + echo "NodeSource setup attempt $i failed, retrying..." + sleep 10 + done apt-get install -y --no-install-recommends nodejs - node --version + NODE_VER=$(node --version) + echo "node: $NODE_VER" + # actions/checkout@v4 требует Node 20+ (ES2022 static blocks). + # Если NodeSource setup упал и установился Ubuntu's Node 12 — фейлим явно. + NODE_MAJOR=$(echo "$NODE_VER" | sed -E 's/^v([0-9]+).*/\1/') + if [ "$NODE_MAJOR" -lt 18 ]; then + echo "ERROR: Node $NODE_VER too old, NodeSource setup likely failed" >&2 + exit 1 + fi - name: Install build deps run: | @@ -80,12 +98,30 @@ jobs: steps: - name: Bootstrap Node 20 + git (для actions/checkout) run: | + set -e export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install -y --no-install-recommends curl git ca-certificates gnupg - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + # NodeSource setup может молча упасть на slow networks (особенно через VPN + # на u4-runner); retry + явная verification что Node >= 18 после install. + for i in 1 2 3; do + if curl -fsSL --retry 3 --retry-delay 5 --connect-timeout 30 \ + https://deb.nodesource.com/setup_20.x | bash -; then + break + fi + echo "NodeSource setup attempt $i failed, retrying..." + sleep 10 + done apt-get install -y --no-install-recommends nodejs - node --version + NODE_VER=$(node --version) + echo "node: $NODE_VER" + # actions/checkout@v4 требует Node 20+ (ES2022 static blocks). + # Если NodeSource setup упал и установился Ubuntu's Node 12 — фейлим явно. + NODE_MAJOR=$(echo "$NODE_VER" | sed -E 's/^v([0-9]+).*/\1/') + if [ "$NODE_MAJOR" -lt 18 ]; then + echo "ERROR: Node $NODE_VER too old, NodeSource setup likely failed" >&2 + exit 1 + fi - name: Install build deps run: |