feat: 合并部分pr请求 #32
Workflow file for this run
This file contains hidden or 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: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: | | |
| npm i -g pnpm | |
| # 清理 esbuild 和 npm 缓存以解决版本冲突 | |
| rm -rf ~/.npm/_cacache | |
| rm -rf node_modules/.cache | |
| rm -rf packages/core/node_modules | |
| # 清理 pnpm store | |
| pnpm store prune || true | |
| # 重新安装依赖,不使用 frozen-lockfile 因为 package.json 已经更新 | |
| pnpm install --force | |
| - name: Build | |
| run: | | |
| # 验证 esbuild 版本 | |
| echo "esbuild version:" | |
| pnpm exec esbuild --version || echo "esbuild not found in root" | |
| cd packages/core && pnpm exec esbuild --version || echo "esbuild not found in core" | |
| # 构建项目 - 只构建 core 包 | |
| # 进入 core 包目录直接执行构建 | |
| cd packages/core | |
| pnpm build | |
| - name: Create Release Pull Request | |
| id: create_release | |
| uses: changesets/action@v1 | |
| with: | |
| tagName: ${{ env.VERSION }} | |
| releaseName: '${{ env.VERSION }}' | |
| publish: pnpm ci:publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |