chore(release): publish new version 0.2.0 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 项目发布 | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest # runs-on 指定job任务运行所需要的虚拟机环境(必填字段) | |
steps: | |
- name: 拉取代码 | |
uses: actions/checkout@v4 | |
- name: 安装 pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9 | |
- name: 设置 Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: 项目安装依赖 | |
run: pnpm install --no-frozen-lockfile | |
- name: 打包项目 | |
run: | | |
pnpm build | |
- name: 更新npmrc | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | |
- name: 发布至npm仓库 | |
run: pnpm release |