Skip to content

✅ v0.7.4: GitHub Actions 最终修复

Choose a tag to compare

@alario-tang alario-tang released this 28 Jul 00:33
· 9 commits to main since this release

✅ LogLayer Support v0.7.4 - GitHub Actions 最终修复

🔧 最终修复

✅ 解决 pnpm 版本冲突

  • 移除重复版本指定:从 Actions 配置中移除 version: 10
  • 自动版本检测:让 pnpm/action-setup@v4 自动从 package.jsonpackageManager 字段读取版本
  • 修复错误:解决 ERR_PNPM_BAD_PM_VERSION 版本冲突错误

🔍 问题分析

之前的错误

Multiple versions of pnpm specified:
- version 10 in the GitHub Action config with the key "version"  
- version pnpm@10.13.0 in the package.json with the key "packageManager"

解决方案

- name: 安装 pnpm
  uses: pnpm/action-setup@v4
  # 移除 with.version,自动从 package.json 读取

📦 预期 Actions 流程

现在 GitHub Actions 应该能够:

  1. 检出代码
  2. 设置 Node.js 18
  3. 自动安装 pnpm@10.13.0(从 package.json)
  4. 配置 pnpm 缓存
  5. 安装 workspace 依赖pnpm install --frozen-lockfile
  6. 构建所有包pnpm build
  7. 发布到 NPMpnpm publish --recursive

🎯 关键改进

  • 完整的 monorepo 支持:处理 workspace:* 协议
  • 缓存优化:pnpm store 缓存提升构建速度
  • 版本一致性:统一使用 package.json 中的版本配置
  • 发布优化--recursive --access public --no-git-checks

🔗 监控地址

GitHub Actions: https://github.com/yai-nexus/loglayer-support/actions


期望结果: 如果此次 Actions 成功运行并发布到 NPM,将标志着 CI/CD 流程完全修复。

Full Changelog: v0.7.3...v0.7.4