-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (41 loc) · 1.06 KB
/
release.yaml
File metadata and controls
49 lines (41 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 }}