@lewisliu0717/npm-oidc-demo 0.0.2 → 0.0.3

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 +21 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,6 +4,27 @@
4
4
 
5
5
  测试包:`@lewisliu0717/npm-oidc-demo`。源码仓库为私有 GitHub 仓库;npm 测试包使用公开可见性,便于使用个人免费账号验证。
6
6
 
7
+ ## 已验证的结果
8
+
9
+ 2026-11-16 已完成真实发布和安装验证:
10
+
11
+ - `0.0.1` 由本机登录后首次发布,用于创建 npm 包。
12
+ - `0.0.2` 由 [GitHub Actions 第 6 次运行](https://github.com/LJHAAAAA/npm-oidc-demo/actions/runs/43834185908) 通过 OIDC 发布,运行提交为 `96528e5`,没有配置 npm 写权限 token。
13
+ - npm 的 Trusted Publisher 状态已变为 `Valid`。
14
+ - 在全新的本地目录中,使用空的 npm 用户配置从官方 registry 安装 `0.0.2`,核对版本并调用 `greet('GitHub OIDC')`,输出 `Hello, GitHub OIDC!`。
15
+
16
+ [查看 npm 测试包](https://www.npmjs.com/package/@lewisliu0717/npm-oidc-demo)
17
+
18
+ ## 后续发布只需三步
19
+
20
+ 1. 完成代码修改后,在本地运行 `npm version patch --no-git-tag-version`,同时更新 `package.json` 和 `package-lock.json` 的版本号。
21
+ 2. 将代码和版本变更提交并推送到 `main`。
22
+ 3. 打开 GitHub Actions → npm OIDC demo → Run workflow,选择 `main`,取消勾选 `dry_run`,再点击 Run workflow。
23
+
24
+ 检查通过后,GitHub Actions 会自动打包并通过 OIDC 发布。每次使用新的版本号;已发布的版本号不能重复发布。
25
+
26
+ 这套发布流程不需要在开发者电脑或 GitHub Secrets 中保存 npm 写权限 token,也不需要每 90 天更换发布 token。首次配置成功后,不需要为每次发布重复登录 npm 或重新配置 Trusted Publisher。
27
+
7
28
  ## 发布方式
8
29
 
9
30
  手动运行工作流时,`dry_run` 默认勾选,只验证身份和打包安装,不发布到 npm。真正发布时才取消勾选。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lewisliu0717/npm-oidc-demo",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "A minimal GitHub Actions and npm OIDC publishing demo",
5
5
  "type": "module",
6
6
  "exports": "./index.js",