Files
BYW-VoiceHub/patches/0012-fix-ci-Preflight-Gitea-container-image-runs-on-ubunt.patch
T

60 lines
2.6 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
From 97af401d894e5b00b6b05b58982dc628603e31c5 Mon Sep 17 00:00:00 2001
From: HenryDu8133 <813367384@qq.com>
Date: Sun, 6 Sep 2026 10:32:55 +0800
Subject: [PATCH 12/58] =?UTF-8?q?fix(ci):=20Preflight=20=E6=94=B9=E4=B8=BA?=
=?UTF-8?q?=20Gitea=20=E6=A0=87=E5=87=86=20container:image=20=E5=86=99?=
=?UTF-8?q?=E6=B3=95=EF=BC=88runs-on=20=E5=8F=AA=E5=A1=AB=20ubuntu-latest?=
=?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=20no=20runner=20matched=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitea/workflows/deploy.yml | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml
index 8f44e10..4e5260c 100644
--- a/.gitea/workflows/deploy.yml
+++ b/.gitea/workflows/deploy.yml
@@ -39,25 +39,30 @@ jobs:
# ============================================================
preflight:
name: Preflight 语法 & 构建检查
- # 国内访问 GitHub actions/node-versions release 经常超时(443 ETIMEDOUT)
- # 所以直接用官方 node:22 镜像跑这个 Job,绕过 setup-node 下载 step
- runs-on: [ubuntu-latest:docker://node:22-bookworm-slim]
+ # ⚠️ Gitea/act_runner 的写法:runs-on 只填注册时的真实标签(我们叫 ubuntu-latest);
+ # 如果要强制用某个 Docker 镜像跑这个 Job,单独写一个 container: 段。
+ # 不能写 "ubuntu-latest:docker://xxx",这是 GitHub Actions 专有语法,Gitea 不认!
+ runs-on: ubuntu-latest
timeout-minutes: 15
+ # 直接用官方 node:22 镜像当 Job 容器(里面自带 node 22 + npm),
+ # 完全绕过 setup-node 从 GitHub release 下载 node tar.gz 的国内超时老坑
+ container:
+ image: node:22-bookworm-slim
steps:
- name: 📥 Checkout 代码
uses: actions/checkout@v4
with:
fetch-depth: 1
- # ── 我们已经用 runs-on: docker://node:22 了,所以这里不需要 actions/setup-node ──
- # 避免国内 Runner 从 github.com 下载 Node tar.gz 出现 ETIMEDOUT
- - name: 🔎 环境自检(node/npm 版本)
+ # ── 已经在 container.image=node:22 里跑了,自带 node 22,不需要 actions/setup-node ──
+ - name: 🔎 环境自检(确认容器里有 node/npm,版本对得上)
shell: bash
run: |
set -euxo pipefail
node -v
npm -v
which node npm
+ cat /etc/os-release 2>/dev/null | head -4 || true
- name: 🧪 安装依赖(npm ci,严格按锁文件)
run: |
--
2.45.1.windows.1