@basic-genomics/hivtrace-viz 1.2.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -155,6 +155,68 @@ ls -la node_modules/@basic-genomics/hivtrace-viz
155
155
  # 应显示:xxx -> ../../../hivtrace-viz
156
156
  ```
157
157
 
158
+ ## 自动发布 (CI/CD)
159
+
160
+ 项目已配置 GitHub Actions 实现全自动版本管理和 npm 发布。
161
+
162
+ ### 配置步骤
163
+
164
+ #### 1. 获取 npm 访问令牌
165
+
166
+ 1. 登录 [npmjs.com](https://www.npmjs.com/)
167
+ 2. 右上角头像 → **Access Tokens** → **Generate New Token**
168
+ 3. 选择 **Automation** 类型
169
+ 4. 复制 Token(只显示一次)
170
+
171
+ #### 2. 配置 GitHub Secrets
172
+
173
+ 1. 进入仓库 **Settings** → **Secrets and variables** → **Actions**
174
+ 2. 点击 **New repository secret**
175
+ 3. 添加:
176
+ - **Name**: `NPM_TOKEN`
177
+ - **Value**: 上一步获取的 token
178
+
179
+ #### 3. 确认 npm 组织权限
180
+
181
+ 确保你的 npm 账号拥有 `@basic-genomics` 组织的发布权限。首次发布需手动执行:
182
+
183
+ ```bash
184
+ npm login
185
+ yarn build
186
+ npm publish --access public
187
+ ```
188
+
189
+ ### 发布流程
190
+
191
+ 配置完成后,发布流程**全自动**:
192
+
193
+ ```
194
+ 提交代码到 main 分支(遵循 Conventional Commits)
195
+
196
+ release-please 自动创建 Release PR
197
+
198
+ 合并 PR → 自动创建 GitHub Release
199
+
200
+ 自动发布到 npm
201
+ ```
202
+
203
+ ### Commit 规范
204
+
205
+ | 格式 | 版本变更 | 示例 |
206
+ |------|----------|------|
207
+ | `feat: xxx` | Minor (1.2.0 → 1.3.0) | `feat: 添加簇追踪功能` |
208
+ | `fix: xxx` | Patch (1.2.0 → 1.2.1) | `fix: 修复上下文菜单定位` |
209
+ | `feat!: xxx` | Major (1.2.0 → 2.0.0) | `feat!: 重构 API 接口` |
210
+ | `chore/docs/style` | 不触发发布 | `docs: 更新 README` |
211
+
212
+ ### 手动测试发布
213
+
214
+ 在 GitHub Actions 中可手动触发 dry-run 测试:
215
+
216
+ 1. 仓库 → **Actions** → **Publish to npm**
217
+ 2. 点击 **Run workflow**
218
+ 3. 勾选 **是否仅测试发布流程**
219
+
158
220
  ## 项目结构
159
221
 
160
222
  ```