Merge pull request #168 from FriedRiceNoodles/changeset-release/master #126
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: | |
- master | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
# 安装 pnpm | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 9.3.0 | |
# 安装依赖 | |
- name: Install dependencies | |
run: pnpm install | |
# 构建 | |
- name: Build | |
run: pnpm build | |
- name: Before Test | |
run: cd packages/banana && pnpm beforeTest | |
# 测试 | |
- name: Test | |
run: pnpm test | |
# 版本变更,创建 PR 或发版 | |
- name: Create Release Pull Request or Publish | |
uses: changesets/action@v1 | |
with: | |
commit: 'chore(release): release by changesets' | |
publish: pnpm changeset publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |