From e9a05bd40043e4a389c57121221085c7f139f1ce Mon Sep 17 00:00:00 2001 From: root <834207172@qq.com> Date: Sat, 11 Apr 2026 13:09:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/.gitlab-c?= =?UTF-8?q?i.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/.gitlab-ci.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/.gitlab-ci.yml b/.gitea/workflows/.gitlab-ci.yml index cde1835..6726139 100644 --- a/.gitea/workflows/.gitlab-ci.yml +++ b/.gitea/workflows/.gitlab-ci.yml @@ -43,12 +43,27 @@ jobs: # run: | # apk add --no-cache git # git --version # 验证 - - name: Checkout - uses: http://106.52.62.106:3000/unity-registry/checkout@v4 - with: - fetch-depth: 1 # 只拉取最新提交,不拉历史 - single-branch: true # 只拉取当前分支 - sparse-checkout: Assets/${{ matrix.module }} +- name: Clone from Local Mirror + run: | + # 检查宿主机是否有镜像(需在 runner 上预置) + if [ -d "/srv/cache/plugin-library.git" ]; then + echo "使用本地裸库镜像..." + git clone --reference /srv/cache/plugin-library.git \ + --depth=1 --filter=blob:none \ + --sparse \ + http://106.52.62.106:3000/root/plugin-library.git . + else + echo "首次克隆,创建本地镜像..." + git clone --bare \ + http://106.52.62.106:3000/root/plugin-library.git \ + /srv/cache/plugin-library.git || true + git clone --reference /srv/cache/plugin-library.git \ + --depth=1 --filter=blob:none \ + --sparse . . + fi + + # 配置稀疏检出 + git sparse-checkout set Assets/${{ matrix.module }} - name: Setup Node.js run: | ln -sf /srv/18-alpine/bin/node /usr/bin/node