Skip to content

[codex] 自动化网站部署与 npm 发布 - #23

Merged
liguochuan00 merged 2 commits into
mainfrom
codex/automate-deployments
Aug 7, 2026
Merged

liguochuan00 merged 2 commits into
mainfrom
codex/automate-deployments

Conversation

@liguochuan00

Copy link
Copy Markdown
Collaborator

变更内容

  • 新增 CI:在 PR 和 main 推送时运行 Node.js 18/20/22 CLI 测试、npm 打包检查和 Astro 构建
  • 新增 GitHub Pages 工作流:从 main 构建 website/dist,通过官方 Pages artifact 发布
  • 新增 npm 发布工作流:仅在 GitHub Release 发布时触发,校验 Tag、包版本和提交归属后使用 Trusted Publishing/OIDC 发布
  • 停用旧的 PPT gh-pages 写入脚本,避免手工部署覆盖 Astro 网站
  • 新增《发布与部署》维护文档

安全边界

  • npm 不会在普通 main 推送时发布
  • npm 发布不保存长期 NPM_TOKEN
  • Release Tag 必须匹配 package.json 版本
  • Release 对应提交必须属于 main
  • Pages 部署使用 github-pages concurrency,避免并发覆盖

验证

  • npm test
  • npm run pack:check
  • npm run build(website/,20 个页面)
  • 三份 workflow YAML 解析通过
  • scripts/sync-gh-pages.sh Shell 语法检查通过
  • git diff --check

合并后设置

  1. GitHub Settings -> Pages -> Source 切换为 GitHub Actions
  2. npmjs.com 为 @double-coding/flow2spec 配置 GitHub Actions Trusted Publisher:double-coding-lab/Flow2Spec + publish-npm.yml

@liguochuan00
liguochuan00 marked this pull request as ready for review August 7, 2026 04:15
@liguochuan00
liguochuan00 merged commit b96f188 into main Aug 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant