@coderpp/yunxiao-cli 0.1.0 → 0.1.4

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.
Files changed (2) hide show
  1. package/README.md +31 -0
  2. package/package.json +13 -1
package/README.md CHANGED
@@ -38,6 +38,37 @@ npm install -g @coderpp/yunxiao-cli
38
38
  yunxiao mr list --state opened
39
39
  ```
40
40
 
41
+ ## CI/CD
42
+
43
+ 仓库包含两个 GitHub Actions 工作流:
44
+
45
+ - `CI`:在 pull request 和 `main` 分支 push 时运行 `npm ci`、`npm test`、`npm run pack:dry-run`。
46
+ - `Publish`:在推送 `v*.*.*` tag 或手动触发时发布 npm 包。
47
+
48
+ 自动发布使用 npm Trusted Publishing,不需要在 GitHub 保存长期 npm token。npm 包设置中需要配置 Trusted Publisher:
49
+
50
+ - Provider:GitHub Actions
51
+ - Organization or user:`coderpp`
52
+ - Repository:`yunxiao-cli`
53
+ - Workflow filename:`publish.yml`
54
+ - Environment name:留空
55
+
56
+ Trusted Publishing 要求发布环境使用 npm CLI 11.5.1 或更高版本,workflow 的发布 job 使用 Node.js 24。
57
+
58
+ 发布新版本的流程:
59
+
60
+ ```bash
61
+ npm version patch
62
+ git push origin main --follow-tags
63
+ ```
64
+
65
+ 如果手动创建 tag,需要确保 tag 和 `package.json` 版本一致,例如:
66
+
67
+ ```bash
68
+ npm version 0.1.1
69
+ git push origin main v0.1.1
70
+ ```
71
+
41
72
  ## 配置
42
73
 
43
74
  不要把个人访问令牌写入代码或提交到仓库。建议通过环境变量提供:
package/package.json CHANGED
@@ -1,16 +1,28 @@
1
1
  {
2
2
  "name": "@coderpp/yunxiao-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.4",
4
4
  "description": "A CLI for Yunxiao Codeup merge request review and merge workflows.",
5
5
  "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/coderpp/yunxiao-cli.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/coderpp/yunxiao-cli/issues"
12
+ },
13
+ "homepage": "https://github.com/coderpp/yunxiao-cli#readme",
6
14
  "bin": {
7
15
  "yunxiao": "dist/src/index.js"
8
16
  },
9
17
  "scripts": {
10
18
  "build": "tsc -p tsconfig.json",
19
+ "pack:dry-run": "npm pack --dry-run",
11
20
  "prepack": "npm run build",
12
21
  "test": "tsc -p tsconfig.json && node --test dist/test/*.test.js"
13
22
  },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
14
26
  "devDependencies": {
15
27
  "@types/node": "^20.12.12",
16
28
  "typescript": "^5.4.5"