更新 .gitea/workflows/.gitlab-ci.yml
Some checks failed
Plugin Library CI / publish (00.BuildOriginality) (push) Has been cancelled
Plugin Library CI / publish (00.StaryEvo) (push) Has been cancelled
Plugin Library CI / publish (00.StaryEvoTools) (push) Has been cancelled
Plugin Library CI / publish (01.HybridCLR) (push) Has been cancelled
Plugin Library CI / publish (10.StoryEditor) (push) Has been cancelled
Plugin Library CI / publish (10.XNode) (push) Has been cancelled
Plugin Library CI / publish (11.PointCloudTools) (push) Has been cancelled
Plugin Library CI / publish (02.InformationSave) (push) Has been cancelled
Plugin Library CI / publish (03.YooAsset) (push) Has been cancelled
Plugin Library CI / publish (04.AudioCore) (push) Has been cancelled
Plugin Library CI / publish (05.TableTextConversion) (push) Has been cancelled
Plugin Library CI / publish (06.UIFarme) (push) Has been cancelled
Plugin Library CI / publish (07.RKTools) (push) Has been cancelled
Plugin Library CI / publish (08.UniTask) (push) Has been cancelled
Plugin Library CI / publish (09.CodeChecker) (push) Has been cancelled
Plugin Library CI / publish (00.ARMazTools) (push) Has been cancelled
Some checks failed
Plugin Library CI / publish (00.BuildOriginality) (push) Has been cancelled
Plugin Library CI / publish (00.StaryEvo) (push) Has been cancelled
Plugin Library CI / publish (00.StaryEvoTools) (push) Has been cancelled
Plugin Library CI / publish (01.HybridCLR) (push) Has been cancelled
Plugin Library CI / publish (10.StoryEditor) (push) Has been cancelled
Plugin Library CI / publish (10.XNode) (push) Has been cancelled
Plugin Library CI / publish (11.PointCloudTools) (push) Has been cancelled
Plugin Library CI / publish (02.InformationSave) (push) Has been cancelled
Plugin Library CI / publish (03.YooAsset) (push) Has been cancelled
Plugin Library CI / publish (04.AudioCore) (push) Has been cancelled
Plugin Library CI / publish (05.TableTextConversion) (push) Has been cancelled
Plugin Library CI / publish (06.UIFarme) (push) Has been cancelled
Plugin Library CI / publish (07.RKTools) (push) Has been cancelled
Plugin Library CI / publish (08.UniTask) (push) Has been cancelled
Plugin Library CI / publish (09.CodeChecker) (push) Has been cancelled
Plugin Library CI / publish (00.ARMazTools) (push) Has been cancelled
This commit is contained in:
@@ -3,7 +3,7 @@ name: Plugin Library CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master, main]
|
branches: [master, main]
|
||||||
workflow_dispatch: # 支持手动触发
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SERVER_HOST: ${{ vars.SERVER_HOST }}
|
SERVER_HOST: ${{ vars.SERVER_HOST }}
|
||||||
@@ -38,41 +38,40 @@ jobs:
|
|||||||
- 11.PointCloudTools
|
- 11.PointCloudTools
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 修正:正确的缩进和结构
|
# 关键:必须先安装 Git(Debian 用 apt-get,不是 apk)
|
||||||
- name: Clone from Local Mirror
|
- name: Install Git
|
||||||
run: |
|
run: |
|
||||||
# 检查宿主机是否有镜像(需在 runner 上预置)
|
apt-get update && apt-get install -y git
|
||||||
if [ -d "/srv/cache/plugin-library.git" ]; then
|
git --version
|
||||||
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
|
|
||||||
|
|
||||||
# 配置稀疏检出
|
- name: Clone with Sparse Checkout
|
||||||
git sparse-checkout set Assets/${{ matrix.module }}
|
run: |
|
||||||
|
git init
|
||||||
|
git remote add origin http://106.52.62.106:3000/root/plugin-library.git
|
||||||
|
git config core.sparseCheckout true
|
||||||
|
|
||||||
|
# 只检出目标模块
|
||||||
|
mkdir -p .git/info
|
||||||
|
echo "Assets/${{ matrix.module }}/*" > .git/info/sparse-checkout
|
||||||
|
|
||||||
|
# 部分克隆:只拉取当前提交的元数据,不拉历史文件
|
||||||
|
git fetch --depth=1 --filter=blob:none origin ${{ github.sha }}
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
echo "已检出:"
|
||||||
|
ls -la Assets/${{ matrix.module }}/
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
run: |
|
run: |
|
||||||
ln -sf /srv/18-alpine/bin/node /usr/bin/node
|
ln -sf /srv/18-alpine/bin/node /usr/bin/node 2>/dev/null || true
|
||||||
ln -sf /srv/18-alpine/bin/npm /usr/bin/npm
|
ln -sf /srv/18-alpine/bin/npm /usr/bin/npm 2>/dev/null || true
|
||||||
node -v
|
node -v
|
||||||
|
|
||||||
- name: Publish ${{ matrix.module }}
|
- name: Publish ${{ matrix.module }}
|
||||||
working-directory: Assets/${{ matrix.module }}
|
working-directory: Assets/${{ matrix.module }}
|
||||||
run: |
|
run: |
|
||||||
echo "开始发布 ${{ matrix.module }}"
|
|
||||||
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
||||||
echo "当前版本: $CURRENT_VERSION"
|
echo "发布 ${{ matrix.module }}@$CURRENT_VERSION"
|
||||||
|
|
||||||
npm config set registry "http://${SERVER_HOST}/npm"
|
npm config set registry "http://${SERVER_HOST}/npm"
|
||||||
npm config set "//${SERVER_HOST}/:_authToken" "${AuthToken}"
|
npm config set "//${SERVER_HOST}/:_authToken" "${AuthToken}"
|
||||||
@@ -81,4 +80,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Complete
|
- name: Complete
|
||||||
if: always()
|
if: always()
|
||||||
run: echo "====== ${{ matrix.module }} 发布完成 ========="
|
run: echo "====== ${{ matrix.module }} 完成 ======"
|
||||||
Reference in New Issue
Block a user