|
|
@@ -18,20 +18,49 @@ Node.js 版本需满足 `package.json` 中的 `>=24.0.0`。
|
|
|
|
|
|
发布前先确认工作区范围,避免把无关变更带上:`git status -sb`、`git log --oneline --decorate -5`。提交或部署前必须运行 `npm run build`、`npm test` 和 `git diff --check`;前端构建会更新 `public/` 下的静态资源,若 hash 变化应与源码一起提交。
|
|
|
|
|
|
-本项目发布需要同步两个 Git 远端:`origin` 指向 `git.ss5.xyz`,用于远程服务器拉取部署;`github` 指向开源仓库,用于同步公开版本。若本地缺少 GitHub remote,先执行一次:
|
|
|
+本项目发布涉及两个本地仓库。当前仓库 `/Users/chendeben/Documents/MailSend` 的 `origin` 指向 `git.ss5.xyz`,用于远程服务器拉取部署;GitHub 开源仓库对应独立本地目录 `/Users/chendeben/Documents/MailHub-public.OlOeo0`,不得在当前仓库直接添加 GitHub remote 后推送。
|
|
|
+
|
|
|
+确认提交后,先推送部署远端:
|
|
|
|
|
|
```bash
|
|
|
-git remote add github git@github.com:chendeben/MailHub.git
|
|
|
+git push origin master
|
|
|
```
|
|
|
|
|
|
-确认提交后,先推送部署远端,再同步 GitHub:
|
|
|
+同步 GitHub 时,进入开源仓库目录,将当前仓库的代码、测试、构建产物和安全配置同步过去,但保留开源仓库的英文公开文档,不同步运行期数据和内部工作流说明:
|
|
|
|
|
|
```bash
|
|
|
-git push origin master
|
|
|
-git push github master
|
|
|
+cd /Users/chendeben/Documents/MailHub-public.OlOeo0
|
|
|
+rsync -a --delete \
|
|
|
+ --exclude='.git/' \
|
|
|
+ --exclude='node_modules/' \
|
|
|
+ --exclude='.env' \
|
|
|
+ --exclude='.env.*' \
|
|
|
+ --exclude='data/' \
|
|
|
+ --exclude='tmp/' \
|
|
|
+ --exclude='.cache/' \
|
|
|
+ --exclude='.superpowers/' \
|
|
|
+ --exclude='.worktrees/' \
|
|
|
+ --exclude='certs/' \
|
|
|
+ --exclude='docs/superpowers/' \
|
|
|
+ --exclude='AGENTS.md' \
|
|
|
+ --exclude='README.md' \
|
|
|
+ --exclude='CHANGELOG.md' \
|
|
|
+ --exclude='CODE_OF_CONDUCT.md' \
|
|
|
+ --exclude='CONTRIBUTING.md' \
|
|
|
+ --exclude='SECURITY.md' \
|
|
|
+ --exclude='SUPPORT.md' \
|
|
|
+ /Users/chendeben/Documents/MailSend/ \
|
|
|
+ /Users/chendeben/Documents/MailHub-public.OlOeo0/
|
|
|
+npm run build
|
|
|
+npm test
|
|
|
+git diff --check
|
|
|
+git status -sb
|
|
|
+git add -A
|
|
|
+git commit
|
|
|
+git push origin main
|
|
|
```
|
|
|
|
|
|
-推送后可用 `git status -sb` 确认本地分支与 `origin/master` 对齐;如需确认 GitHub,也可运行 `git ls-remote github refs/heads/master` 对比本地 `git rev-parse HEAD`。
|
|
|
+开源仓库提交信息同样使用 Conventional Commits 风格。推送后可用 `git status -sb` 确认 `main` 与 `origin/main` 对齐;如需确认 GitHub,也可运行 `git ls-remote origin refs/heads/main` 对比本地 `git rev-parse HEAD`。
|
|
|
|
|
|
生产部署使用远程脚本:
|
|
|
|