Skip to content

Commit f59a7b5

Browse files
committed
feat: add build job
1 parent 9a1a1f2 commit f59a7b5

File tree

4 files changed

+73
-8
lines changed

4 files changed

+73
-8
lines changed

.github/workflows/build.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build App
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
strategy:
10+
matrix:
11+
include:
12+
- os: ubuntu-latest
13+
arch: x64
14+
platform: linux
15+
- os: ubuntu-latest
16+
arch: arm64
17+
platform: linux
18+
- os: windows-latest
19+
arch: x64
20+
platform: win32
21+
- os: macos-latest
22+
arch: x64
23+
platform: darwin
24+
- os: macos-latest
25+
arch: arm64
26+
platform: darwin
27+
28+
runs-on: ${{ matrix.os }}
29+
30+
steps:
31+
- name: Checkout Repository
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '22'
38+
39+
- name: Install Dependencies
40+
run: npm install
41+
42+
- name: Build App
43+
run: npx electron-rebuild --arch=${{ matrix.arch }}
44+
45+
- name: Build App
46+
run: npx electron-packager . AES67 --out=release-builds --icon=./assets/icon --arch=${{ matrix.arch }} --platform=${{ matrix.platform }}
47+
48+
- name: Zip Build Folder (Linux/macOS)
49+
if: runner.os != 'Windows'
50+
run: |
51+
folder=$(ls -d release-builds/*)
52+
cd "$folder"
53+
zip -r "../AES67-${{ matrix.os }}-${{ matrix.arch }}.zip" *
54+
55+
- name: Zip Build Folder (Windows)
56+
if: runner.os == 'Windows'
57+
shell: pwsh
58+
run: |
59+
$folder = Get-ChildItem -Directory -Path release-builds | Select-Object -First 1
60+
Compress-Archive -Path "$($folder.FullName)\*" -DestinationPath "AES67-${{ matrix.os }}-${{ matrix.arch }}.zip"
61+
62+
- name: Upload Artifacts
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: AES67-${{ matrix.os }}-${{ matrix.arch }}
66+
path: release-builds/AES67-${{ matrix.os }}-${{ matrix.arch }}.zip

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ release-builds/
44
node_modules/
55
package-lock.json
66
.DS_Store
7-
test.js

js/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ var devices = rtAudio.getDevices();
265265

266266
for(var i = 0; i < devices.length; i++){
267267
if(devices[i].outputChannels >= 2){
268-
app.audiodevices.push({id: i, name: devices[i].name, samplerates: devices[i].sampleRates});
268+
app.audiodevices.push({id: devices[i].id, name: devices[i].name, samplerates: devices[i].sampleRates});
269269
}
270270
}
271271

272272
if(app.audiodevices.length == 0){
273273
app.errors.push('No valid audio device found! Please connect an audio device and restart the app.');
274-
}else if(devices[rtAudio.getDefaultOutputDevice()].outputChannels >= 2){
274+
}else if(devices.find(item => item.id === rtAudio.getDefaultOutputDevice()).outputChannels >= 2){
275275
app.settings.device = rtAudio.getDefaultOutputDevice();
276276
}else{
277277
app.settings.device = app.audiodevices[0].id;

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"main": "main.js",
66
"scripts": {
77
"start": "electron .",
8-
"build": "npx electron-packager . AES67 --overwrite --platform=darwin,linux --arch=x64,arm64 --out=release-builds --icon=./assets/icon",
9-
"buildWin": "npx electron-packager . AES67 --overwrite --platform=win32 --arch=x64 --out=release-builds --icon=./assets/icon"
8+
"build": "npx electron-packager . AES67 --overwrite --out=release-builds --icon=./assets/icon"
109
},
1110
"devDependencies": {
1211
"@electron/packager": "^18.3.6",
12+
"@electron/rebuild": "^3.7.1",
1313
"electron": "^34.2.0"
1414
},
1515
"dependencies": {
16-
"audify": "1.5.2",
17-
"jquery": "^3.5.1",
18-
"sdp-transform": "^2.14.1",
16+
"audify": "1.9.0",
17+
"jquery": "^3.7.1",
18+
"sdp-transform": "^2.15.0",
1919
"vue": "^2.6.11"
2020
}
2121
}

0 commit comments

Comments
 (0)