Merge branch 'main' of https://github.com/moohng/unoapi #62
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: 发布包 & 创建版本 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: # 手动触发也可以 | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1️⃣ 拉取代码 | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| # 3️⃣ 设置 pnpm & 安装依赖 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| # 2️⃣ 设置 Node 环境 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| # 4️⃣ 安装 | |
| - name: Build packages | |
| run: | |
| pnpm install | |
| # 5️⃣ 创建新版本 & 发布 & 生成 release | |
| - name: Create and publish new versions | |
| uses: changesets/action@v1 | |
| with: | |
| version: pnpm changeset version | |
| publish: pnpm ci:publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |