fix: 更新 release-please 配置以调整拉取请求标题格式并添加组件信息 #10
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: release | |
on: | |
push: | |
branches: | |
- main | |
# 赋予 release-please-action 权限 | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
# 设置 release-please 任务 | |
release-please: | |
# 设置任务运行环境为 ubuntu-latest | |
runs-on: ubuntu-latest | |
steps: | |
# 使用 release-please-action 动作来自动创建发布 PR | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
config-file: .release-please-config.json | |
manifest-file: .release-please-manifest.json | |
- name: 检出代码 | |
uses: actions/checkout@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
# 安装 pnpm | |
- uses: pnpm/action-setup@v2 | |
if: ${{ steps.release.outputs.release_created }} | |
with: | |
version: 8 | |
# 设置 Node.js 环境 | |
- name: 设置 Node.js 环境 | |
uses: actions/setup-node@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
with: | |
node-version: 20 | |
registry-url: "https://registry.npmjs.org" | |
# 安装依赖 | |
- name: 安装依赖 | |
if: ${{ steps.release.outputs.release_created }} | |
run: pnpm install | |
# 构建输出 | |
- name: 构建输出 | |
if: ${{ steps.release.outputs.release_created }} | |
run: pnpm build | |
# 重新安装依赖 | |
- name: 删除所文件 重新安装依赖 | |
if: ${{ steps.release.outputs.release_created }} | |
run: rm -rf pnpm-lock.yaml && pnpm install | |
# 发布到 npm | |
- name: 发布到 npm | |
if: ${{ steps.release.outputs.release_created }} | |
run: pnpm pub | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |