-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.2 KB
/
Copy pathbuild.yml
File metadata and controls
48 lines (40 loc) · 1.2 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
name: Build Browser Extension
on:
push:
branches:
- main
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1. 检出代码
- name: Checkout repository
uses: actions/checkout@v4
# 2. 安装 pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10 # 根据你项目使用的 pnpm 版本调整
# 3. 配置 Node.js 并启用 pnpm 缓存
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24' # 根据项目需要选择 Node 版本
cache: 'pnpm'
# 4. 安装依赖
- name: Install dependencies
run: pnpm install --frozen-lockfile
# 5. 构建 Chrome (zip) 与 Firefox (zip:firefox) 两个版本
- name: Build extension packages
run: |
pnpm zip
pnpm zip:firefox
# 6. 上传 ZIP 产物(请根据实际输出目录调整路径)
# 常见的 WXT 输出位置是 .output/,也可能在 dist/ 下
- name: Upload ZIP artifacts
uses: actions/upload-artifact@v4
with:
name: extension-packages
path: .output/*.zip