Skip to content

Commit 14caba5

Browse files
authored
Merge pull request #328 from Ezviz-OpenBiz/develop
demos: add electron
2 parents d2b1e6d + c682a6d commit 14caba5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+16277
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: build-electron-mac
2+
3+
on:
4+
push:
5+
branches: ["main", "develop"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 21.x, 22.x, 23.x, 24.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- uses: pnpm/action-setup@v3
24+
with:
25+
version: 8
26+
27+
- name: Build with-electron
28+
working-directory: ./demos/with-electron
29+
run: |
30+
pnpm install --no-frozen-lockfile
31+
pnpm run build
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: build-electron
2+
3+
on:
4+
push:
5+
branches: ["main", "develop"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [macos-latest, windows-latest, ubuntu-latest] #
16+
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
26+
- name: Build with-electron
27+
working-directory: ./demos/with-electron
28+
run: |
29+
yarn install --no-frozen-lockfile
30+
yarn run build

.github/workflows/build-nextjs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ jobs:
3030
pnpm install --no-frozen-lockfile
3131
pnpm run build
3232
33-

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ build/
2121
npm-debug.log*
2222
npm-error.log*
2323
yarn-debug.log*
24+
demos/with-electron/release
2425

2526

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ alpha(功能测试)、beta(集成测试)为我们的非正式版本,
115115
116116
> 如果使用 next.js,可参考 demos => [with-next](https://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/tree/master/demos/with-next)
117117
118+
> 如果使用 electron,可参考 demos => [with-electron](https://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/tree/master/demos/with-electron)
119+
118120
> 如果使用 vue3,可参考 demos => [vue3-demo](https://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/tree/master/demos/vue3-demo)
119121
120122
> 如果使用 vue2.7,可参考 demos => [vue-demo](https://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/tree/master/demos/vue-demo)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
/**
3+
* @see https://www.electron.build/configuration/configuration
4+
*/
5+
{
6+
appId: 'com.ezuikit.app',
7+
asar: true,
8+
directories: {
9+
output: 'release/${version}',
10+
},
11+
files: ['src'],
12+
mac: {
13+
artifactName: '${productName}_${version}.${ext}',
14+
target: ['dmg', 'zip'],
15+
},
16+
win: {
17+
target: [
18+
{
19+
target: 'nsis',
20+
arch: ['x64'],
21+
},
22+
],
23+
artifactName: '${productName}_${version}.${ext}',
24+
},
25+
nsis: {
26+
oneClick: false,
27+
perMachine: false,
28+
allowToChangeInstallationDirectory: true,
29+
deleteAppDataOnUninstall: true,
30+
installerIcon: 'resource/icon.ico',
31+
installerHeaderIcon: 'resource/icon.ico',
32+
}
33+
}

demos/with-electron/package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "with-electron",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "src/main.js",
6+
"scripts": {
7+
"dev": "npx electron .",
8+
"build": "electron-builder"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"dependencies": {},
14+
"devDependencies": {
15+
"electron": "^36.3.2",
16+
"electron-builder": "^26.0.12"
17+
}
18+
}

0 commit comments

Comments
 (0)