File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change 99 publish-npm :
1010 runs-on : ubuntu-latest
1111 steps :
12+ # checkout 代码
1213 - uses : actions/checkout@v4
1314 with :
1415 fetch-depth : 0 # 获取完整历史
1516 clean : true # 清理工作目录
16- - uses : actions/setup-node@v1
17+ # 准备 node
18+ - uses : actions/setup-node@v4
1719 with :
1820 node-version : 18
1921 registry-url : https://registry.npmjs.org/
20- - run : git config --global user.email ${{secrets.USER_EMAIL}}
21- - run : git config --global user.name ${{secrets.USER_NAME}}
22- - run : npm install pnpm -g
23- - run : pnpm install
24- - run : pnpm build
22+ # 准备 pnpm
23+ - uses : pnpm/action-setup@v4
24+ with :
25+ version : 8
26+ cache : pnpm
27+ # 配置 git 用户
28+ - name : Setup git user
29+ run : |
30+ git config --global user.email ${{secrets.USER_EMAIL}}
31+ git config --global user.name ${{secrets.USER_NAME}}
32+ # 安装依赖
33+ - name : Install dependencies
34+ run : pnpm install
35+ # 构建产物
36+ - name : Build
37+ run : pnpm build
38+ # 强制同步远程 git 标签(消除远程已删除的 tag 缓存对 Lerna 计算 commit 的影响)
2539 - name : Sync git tags
2640 run : |
2741 git fetch --prune --prune-tags # 清理已删除的远程标签
2842 git fetch --tags -f # 强制更新所有标签
43+ # Lerna 发布
2944 - name : Publish with Lerna
3045 env :
3146 NODE_AUTH_TOKEN : ${{secrets.npm_token}}
You can’t perform that action at this time.
0 commit comments