Skip to content

Commit f79ffc4

Browse files
committed
更新构建设置
1 parent c4234dd commit f79ffc4

22 files changed

+522
-281
lines changed

.github/workflows/beta-pack.yml

+31-35
Original file line numberDiff line numberDiff line change
@@ -75,55 +75,51 @@ jobs:
7575
uses: actions/upload-artifact@v3
7676
with:
7777
name: lx-music-desktop-x64-Setup
78-
path: build/* x64 Setup.exe
78+
path: build/*-x64-Setup.exe
7979

8080
- name: Build Package 7z x64
8181
run: npm run pack:win:7z:x64
8282
- name: Upload Artifact 7z x64
8383
uses: actions/upload-artifact@v3
8484
with:
8585
name: lx-music-desktop-win_x64-green
86-
path: build/*win_x64 green.7z
87-
88-
- name: Build Package Setup x86
89-
run: npm run pack:win:setup:x86
90-
- name: Upload Artifact Setup x86
91-
uses: actions/upload-artifact@v3
92-
with:
93-
name: lx-music-desktop-x86-Setup
94-
path: build/* x86 Setup.exe
95-
96-
- name: Build Package 7z x86
97-
run: npm run pack:win:7z:x86
98-
- name: Upload Artifact 7z x86
99-
uses: actions/upload-artifact@v3
100-
with:
101-
name: lx-music-desktop-win_x86-green
102-
path: build/*win_x86 green.7z
86+
path: build/*win_x64-green.7z
10387

10488
- name: Build Package Setup arm64
10589
run: npm run pack:win:setup:arm64
10690
- name: Upload Artifact Setup arm64
10791
uses: actions/upload-artifact@v3
10892
with:
10993
name: lx-music-desktop-arm64-Setup
110-
path: build/* arm64 Setup.exe
94+
path: build/*-arm64-Setup.exe
11195

11296
- name: Build Package 7z arm64
11397
run: npm run pack:win:7z:arm64
11498
- name: Upload Artifact 7z arm64
11599
uses: actions/upload-artifact@v3
116100
with:
117101
name: lx-music-desktop-win_arm64-green
118-
path: build/*win_arm64 green.7z
102+
path: build/*win_arm64-green.7z
103+
104+
105+
- name: Install old electron
106+
run: npm install electron@22
107+
108+
- name: Build Package win7 7z x64
109+
run: npm run pack:win7:7z:x64
110+
- name: Upload Artifact win7 7z x64
111+
uses: actions/upload-artifact@v3
112+
with:
113+
name: lx-music-desktop-win7_x64-green
114+
path: build/*win7_x64-green.7z
119115

120-
- name: Build Package Setup x86_64
121-
run: npm run pack:win:setup:x86_64
122-
- name: Upload Artifact Setup x86_64
116+
- name: Build Package win7 7z x86
117+
run: npm run pack:win7:7z:x86
118+
- name: Upload Artifact win7 7z x86
123119
uses: actions/upload-artifact@v3
124120
with:
125-
name: lx-music-desktop-x86_64-Setup
126-
path: build/*x86_64 Setup.exe
121+
name: lx-music-desktop-win7_x86-green
122+
path: build/*win7_x86-green.7z
127123

128124
- name: Generate file MD5
129125
run: |
@@ -223,53 +219,53 @@ jobs:
223219
- name: Build src code
224220
run: npm run build
225221

226-
- name: Build Package deb x64
227-
run: npm run pack:linux:deb:x64
228-
- name: Upload Artifact deb x64
222+
- name: Build Package deb amd64
223+
run: npm run pack:linux:deb:amd64
224+
- name: Upload Artifact deb amd64
229225
uses: actions/upload-artifact@v3
230226
with:
231-
name: lx-music-desktop-deb-x64
232-
path: build/* x64.deb
227+
name: lx-music-desktop-deb-amd64
228+
path: build/*_amd64.deb
233229

234230
- name: Build Package deb arm64
235231
run: npm run pack:linux:deb:arm64
236232
- name: Upload Artifact deb arm64
237233
uses: actions/upload-artifact@v3
238234
with:
239235
name: lx-music-desktop-deb-arm64
240-
path: build/* arm64.deb
236+
path: build/*_arm64.deb
241237

242238
- name: Build Package deb armv7l
243239
run: npm run pack:linux:deb:armv7l
244240
- name: Upload Artifact deb armv7l
245241
uses: actions/upload-artifact@v3
246242
with:
247243
name: lx-music-desktop-deb-armv7l
248-
path: build/* armv7l.deb
244+
path: build/*_armv7l.deb
249245

250246
- name: Build Package x64 appImage
251247
run: npm run pack:linux:appImage
252248
- name: Upload Artifact x64 appImage
253249
uses: actions/upload-artifact@v3
254250
with:
255251
name: lx-music-desktop-x64-appImage
256-
path: build/* x64.AppImage
252+
path: build/*_x64.AppImage
257253

258254
- name: Build Package x64 rpm
259255
run: npm run pack:linux:rpm
260256
- name: Upload Artifact x64 rpm
261257
uses: actions/upload-artifact@v3
262258
with:
263259
name: lx-music-desktop-x64-rpm
264-
path: build/* x64.rpm
260+
path: build/*.x64.rpm
265261

266262
- name: Build Package x64 pacman
267263
run: npm run pack:linux:pacman
268264
- name: Upload Artifact x64 pacman
269265
uses: actions/upload-artifact@v3
270266
with:
271267
name: lx-music-desktop-x64-pacman
272-
path: build/* x64.pacman
268+
path: build/*_x64.pacman
273269

274270
- name: Generate file MD5
275271
run: |

.github/workflows/release.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ jobs:
7171

7272
- name: Release package
7373
run: |
74-
npm run publish:win:setup:x64:always
75-
npm run publish:win:7z:x64
76-
npm run publish:win:setup:x86
77-
npm run publish:win:7z:x86
74+
npm run publish:win:7z:x64:always
7875
npm run publish:win:setup:arm64
79-
npm run publish:win:7z:arm64
80-
npm run publish:win:setup:x86_64
76+
npm run publish:win:setup:x64
77+
npm install electron@22
78+
npm run publish:win7:7z:x64
79+
npm run publish:win7:7z:x86
8180
env:
8281
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8382
BT_TOKEN: ${{ secrets.BT_TOKEN }}
@@ -171,7 +170,7 @@ jobs:
171170

172171
- name: Release package
173172
run: |
174-
npm run publish:linux:deb:x64:always
173+
npm run publish:linux:deb:amd64:always
175174
npm run publish:linux:deb:arm64
176175
npm run publish:linux:deb:armv7l
177176
npm run publish:linux:appImage

build-config/build-before-pack.js

+21-18
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,47 @@ const fs = require('fs')
22
const fsPromises = require('fs').promises
33
const path = require('path')
44
const { Arch } = require('electron-builder')
5+
const nodeAbi = require('node-abi')
56

67
const better_sqlite3_fileNameMap = {
7-
[Arch.x64]: 'electron-v110-linux-x64',
8-
[Arch.arm64]: 'electron-v110-linux-arm64',
9-
[Arch.armv7l]: 'electron-v110-linux-arm',
8+
[Arch.x64]: 'linux-x64',
9+
[Arch.arm64]: 'linux-arm64',
10+
[Arch.armv7l]: 'linux-arm',
1011
}
1112

1213
const qrc_decode_fileNameMap = {
1314
win32: {
14-
[Arch.x64]: 'electron-v110-win32-x64',
15-
[Arch.ia32]: 'electron-v110-win32-ia32',
16-
[Arch.arm64]: 'electron-v110-win32-arm64',
15+
[Arch.x64]: 'win32-x64',
16+
[Arch.ia32]: 'win32-ia32',
17+
[Arch.arm64]: 'win32-arm64',
1718
},
1819
linux: {
19-
[Arch.x64]: 'electron-v110-linux-x64',
20-
[Arch.arm64]: 'electron-v110-linux-arm64',
21-
[Arch.armv7l]: 'electron-v110-linux-arm',
20+
[Arch.x64]: 'linux-x64',
21+
[Arch.arm64]: 'linux-arm64',
22+
[Arch.armv7l]: 'linux-arm',
2223
},
2324
darwin: {
24-
[Arch.x64]: 'electron-v110-darwin-x64',
25-
[Arch.arm64]: 'electron-v110-darwin-arm64',
25+
[Arch.x64]: 'darwin-x64',
26+
[Arch.arm64]: 'darwin-arm64',
2627
},
2728
}
2829

29-
const replaceSqliteLib = async(arch) => {
30+
const replaceSqliteLib = async(electronNodeAbi, arch) => {
3031
// console.log(await fs.readdir(path.join(context.appOutDir, './resources/')))
3132
// if (context.electronPlatformName != 'linux' || context.arch != Arch.arm64) return
3233
// https://github.com/lyswhut/lx-music-desktop/issues/1102
3334
// https://github.com/lyswhut/lx-music-desktop/issues/1161
3435
console.log('replace sqlite lib...')
35-
const filePath = path.join(__dirname, `./lib/better_sqlite3_${better_sqlite3_fileNameMap[arch]}.node`)
36+
const filePath = path.join(__dirname, `./lib/better_sqlite3_electron-v${electronNodeAbi}-${better_sqlite3_fileNameMap[arch]}.node`)
37+
console.log(filePath)
3638
const targetPath = path.join(__dirname, '../node_modules/better-sqlite3/build/Release/better_sqlite3.node')
3739
await fsPromises.unlink(targetPath).catch(_ => _)
3840
await fsPromises.copyFile(filePath, targetPath)
3941
}
4042

41-
const replaceQrcDecodeLib = async(platform, arch) => {
42-
console.log('replace qrc_decode lib...', platform, qrc_decode_fileNameMap[platform][arch])
43-
const filePath = path.join(__dirname, `./lib/qrc_decode_${qrc_decode_fileNameMap[platform][arch]}.node`)
43+
const replaceQrcDecodeLib = async(electronNodeAbi, platform, arch) => {
44+
console.log('replace qrc_decode lib...', platform, electronNodeAbi, qrc_decode_fileNameMap[platform][arch])
45+
const filePath = path.join(__dirname, `./lib/qrc_decode_electron-v${electronNodeAbi}-${qrc_decode_fileNameMap[platform][arch]}.node`)
4446
const targetPath = path.join(__dirname, '../build/Release/qrc_decode.node')
4547
const targetDir = path.dirname(targetPath)
4648
if (fs.existsSync(targetDir)) await fsPromises.unlink(targetPath).catch(_ => _)
@@ -51,7 +53,8 @@ const replaceQrcDecodeLib = async(platform, arch) => {
5153

5254
module.exports = async(context) => {
5355
const { electronPlatformName, arch } = context
54-
await replaceQrcDecodeLib(electronPlatformName, arch)
56+
const electronNodeAbi = nodeAbi.getAbi(context.packager.info._framework.version, 'electron')
57+
await replaceQrcDecodeLib(electronNodeAbi, electronPlatformName, arch)
5558
if (electronPlatformName !== 'linux' || process.env.FORCE) return
5659
const bindingFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp')
5760
const bindingBakFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp.bak')
@@ -63,7 +66,7 @@ module.exports = async(context) => {
6366
// console.log('rename binding file...')
6467
await fsPromises.rename(bindingFilePath, bindingBakFilePath)
6568
}
66-
await replaceSqliteLib(arch)
69+
await replaceSqliteLib(electronNodeAbi, arch)
6770
break
6871

6972
default:

0 commit comments

Comments
 (0)