Skip to content

Commit 02fc0e3

Browse files
committed
chore(ci): 更新 GitHub Actions 工作流,支持多平台 Electron 构建
chore(ci): 使用 cnpm 安装依赖,解决 CI 环境缺少锁定文件的问题 chore(ci): 安装 cnpm 依赖解决找不到锁的问题 chore(ci): 添加生成锁文件解决找不到锁的问题 chore(ci): 更改使用npm,生成锁文件 chore(cl): 多平台独立构建 chore(ci): 更新 GitHub Actions 工作流多平台分开独立构建 chore: 添加 Linux 构建图标并更新构建配置
1 parent 2527693 commit 02fc0e3

File tree

6 files changed

+9822
-4
lines changed

6 files changed

+9822
-4
lines changed

.github/workflows/package.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build Electron App
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build_ubuntu:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 18
18+
- name: Install dependencies
19+
run: npm install
20+
- name: Build project
21+
run: npm run build
22+
- name: Upload build artifacts
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: ubuntu-build
26+
path: dist_electron/
27+
28+
build_windows:
29+
runs-on: windows-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
- name: Set up Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 18
37+
- name: Install dependencies
38+
run: npm install
39+
- name: Build project
40+
run: npm run build
41+
- name: Upload build artifacts
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: windows-build
45+
path: dist_electron/
46+
47+
build_macos:
48+
runs-on: macos-latest
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v4
52+
- name: Set up Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 18
56+
- name: Install dependencies
57+
run: npm install
58+
- name: Build project
59+
run: npm run build
60+
- name: Upload build artifacts
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: macos-build
64+
path: dist_electron/

README-zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ git clone https://github.com/ProgramCX/flow_im_app.git
4040
2. 安装依赖
4141
```bash
4242
cd flow_im_app
43-
44-
cnpm install #如果你在中国大陆地区,建议使用cnpm安装依赖
43+
npm set registry https://registry.npmmirror.com # 如果在中国大陆地区,建议使用淘宝镜像
44+
npm install
4545
```
4646

4747
3. 启动项目

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ git clone https://github.com/ProgramCX/flow_im_app.git
3939
2. Install dependencies:
4040
```bash
4141
cd flow_im_app
42-
cnpm install # If you are in mainland China, using cnpm is recommended.
42+
npm set registry https://registry.npmmirror.com # If you are in mainland China, using the Taobao mirror is recommended.
43+
npm install
4344
```
4445
3. Start the project:
4546
```bash

electron-builder.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@
3232
linux: {
3333
target: ["AppImage"],
3434
artifactName: "${productName}-Linux-${version}.${ext}",
35+
"icon": "public/icon/icon.png",
3536
},
3637
}

0 commit comments

Comments
 (0)