From df63a06aeab39ce34e871bdff04f964ecd3f96e1 Mon Sep 17 00:00:00 2001 From: gouki Date: Wed, 21 Oct 2026 09:04:51 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E5=89=8D=E7=AB=AF=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20npm=E2=80=94=E2=80=94core=20=E4=B8=BA?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E5=8C=85=E6=97=A0=E9=9C=80=20pnpm=20?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8C=BA=EF=BC=8C=E7=BB=95=E5=BC=80=20runner?= =?UTF-8?q?=20=E5=AE=89=E8=A3=85=20pnpm=20=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/web-deploy.yml | 48 +++++++-------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/.gitea/workflows/web-deploy.yml b/.gitea/workflows/web-deploy.yml index dbec36b..df952da 100644 --- a/.gitea/workflows/web-deploy.yml +++ b/.gitea/workflows/web-deploy.yml @@ -105,38 +105,6 @@ jobs: fi echo "PATH=$TOOLDIR/node/bin:$PATH" >> "$GITEA_ENV" - - name: Install pnpm - run: | - export HOME="$RUNNER_WORKSPACE" - # pnpm 随工具链缓存;linuxstatic 单文件二进制不依赖 npm registry - # 且同时兼容 glibc/musl runner(npm install -g 在多个 runner 上不稳定) - TOOLDIR="$RUNNER_WORKSPACE/.lunar-toolchain" - mkdir -p "$TOOLDIR/pnpm/bin" - PNPM_VER=11.13.1 - if [ ! -x "$TOOLDIR/pnpm/bin/pnpm" ]; then - DL_OK="" - for url in \ - "https://registry.npmmirror.com/-/binary/pnpm/v$PNPM_VER/pnpm-linuxstatic-x64" \ - "https://github.com/pnpm/pnpm/releases/download/v$PNPM_VER/pnpm-linuxstatic-x64"; do - echo "尝试下载: $url" - if wget -q -t 2 -T 60 -O "$TOOLDIR/pnpm/bin/pnpm" "$url"; then - chmod +x "$TOOLDIR/pnpm/bin/pnpm" - if "$TOOLDIR/pnpm/bin/pnpm" --version >/dev/null 2>&1; then - DL_OK=1 - echo "下载成功" - break - fi - echo "二进制无法执行,尝试下一源" - else - echo "下载失败,尝试下一源" - fi - rm -f "$TOOLDIR/pnpm/bin/pnpm" - done - test -n "$DL_OK" || { echo "::error::pnpm 所有下载源均失败"; exit 1; } - fi - echo "PATH=$TOOLDIR/pnpm/bin:$PATH" >> "$GITEA_ENV" - "$TOOLDIR/pnpm/bin/pnpm" --version - - name: Run Go tests working-directory: server run: | @@ -151,14 +119,16 @@ jobs: CI: "true" run: | export HOME="$RUNNER_WORKSPACE" - # 用户级 npmrc:pnpm install 依赖下载走镜像源(lockfile 校验不受影响) + # 依赖下载走 npmmirror;npm/pnpm 全局限定在部分 runner 不稳定, + # 故不使用 pnpm 工作区——core 是独立包,npm install 即可构建 npm config set registry https://registry.npmmirror.com || true - # web/ 工作区:装依赖并构建 @lunar/core(web-commercial 的 file: 依赖) - cd web - pnpm install --frozen-lockfile - pnpm --filter @lunar/core build - cd ../web-commercial - pnpm install --frozen-lockfile + # @lunar/core:web-commercial 的 file: 依赖与 vite/tsconfig 别名目标 + cd web/packages/core + npm install + npx tsup + test -f dist/index.js + cd ../../../web-commercial + npm install npx tsc -b npx vite build test -f dist/index.html