Skip to content

Commit 8386678

Browse files
committed
chore: migrate npm publishing to OIDC
1 parent 33c31b0 commit 8386678

4 files changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/auto-publish.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
tags:
1010
- 'v*'
1111

12+
permissions:
13+
contents: write
14+
id-token: write
15+
1216
# 定义工作流中的作业
1317
jobs:
1418
build:
@@ -29,7 +33,7 @@ jobs:
2933
- name: Setup Node
3034
uses: actions/setup-node@v5
3135
with:
32-
node-version: 22 # 使用Node.js 22版本
36+
node-version: 24 # 使用Node.js 24版本
3337
package-manager-cache: false
3438
registry-url: 'https://registry.npmjs.org' # 设置npm registry地址
3539

@@ -89,10 +93,7 @@ jobs:
8993
9094
# 步骤8: 发布组件到NPM
9195
- name: Publish components
92-
run: pnpm lerna publish from-package --pre-dist-tag ${{steps.parse_tag.outputs.dist_tag}} --yes
93-
env:
94-
# 使用NPM令牌进行身份验证
95-
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_ROBOT_TOKEN }}
96+
run: pnpm lerna publish from-package --pre-dist-tag ${{ steps.parse_tag.outputs.dist_tag }} --yes
9697

9798
# 步骤9: 发布组件到GitHub Release
9899
- name: Release

lerna.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"npmClient": "pnpm"
1212
},
1313
"ignoreChanges": ["**/*.md", "**/test/**", ".npmrc"],
14-
"granularPathspec": false
14+
"granularPathspec": false,
15+
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
1516
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"eslint-plugin-vue": "^10.0.0",
3737
"husky": "^9.1.7",
3838
"jiti": "^2.4.2",
39-
"lerna": "^7.2.0",
39+
"lerna": "^9.0.7",
4040
"lint-staged": "^15.5.0",
4141
"prettier": "^3.5.3",
4242
"typescript": "^5.2.2"

packages/cli/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
"name": "@opentiny/tiny-robot-cli",
33
"version": "0.5.0",
44
"description": "CLI to scaffold TinyRobot product projects",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/opentiny/tiny-robot.git"
8+
},
9+
"publishConfig": {
10+
"access": "public"
11+
},
512
"type": "module",
613
"bin": {
714
"tiny-robot-cli": "./bin/cli.js"

0 commit comments

Comments
 (0)