Skip to content

Commit 7782bb1

Browse files
fix(app): reconcile electron builder configs (#11)
1 parent 3dec389 commit 7782bb1

File tree

4 files changed

+176
-231
lines changed

4 files changed

+176
-231
lines changed

.github/workflows/build-desktop.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,27 @@ jobs:
278278
APPLE_ID: ${{ secrets.APPLE_ID }}
279279
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
280280
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
281-
run: pnpm exec electron-builder --config electron-builder.yaml --mac --${{ matrix.electron_arch }}
281+
run: pnpm exec electron-builder --config electron-builder.config.cjs --mac --${{ matrix.electron_arch }}
282+
283+
- name: Verify macOS bundle ID (fail fast if wrong channel)
284+
if: matrix.platform == 'macos'
285+
working-directory: ${{ env.APP_WORKDIR }}
286+
shell: bash
287+
env:
288+
BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
289+
run: |
290+
set -euo pipefail
291+
DIST="dist-electron"
292+
ZIP="$(ls -1 "$DIST"/*"${{ matrix.electron_arch }}"*.zip | head -n1)"
293+
tmp="$(mktemp -d)"
294+
ditto -xk "$ZIP" "$tmp"
295+
APP="$(find "$tmp" -maxdepth 2 -name "*.app" -print -quit)"
296+
BID=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$APP/Contents/Info.plist")
297+
298+
expected="app.fluxer"
299+
if [[ "${BUILD_CHANNEL:-stable}" == "canary" ]]; then expected="app.fluxer.canary"; fi
300+
echo "Bundle id in zip: $BID (expected: $expected)"
301+
test "$BID" = "$expected"
282302
283303
- name: Build Electron app (Windows)
284304
if: matrix.platform == 'windows'
@@ -289,7 +309,7 @@ jobs:
289309
TMP: C:\t
290310
SQUIRREL_TEMP: C:\sq
291311
ELECTRON_BUILDER_CACHE: C:\ebcache
292-
run: pnpm exec electron-builder --config electron-builder.yaml --win --${{ matrix.electron_arch }}
312+
run: pnpm exec electron-builder --config electron-builder.config.cjs --win --${{ matrix.electron_arch }}
293313

294314
- name: Analyze Squirrel nupkg for long paths
295315
if: matrix.platform == 'windows'
@@ -362,7 +382,7 @@ jobs:
362382
env:
363383
BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
364384
USE_SYSTEM_FPM: true
365-
run: pnpm exec electron-builder --config electron-builder.yaml --linux --${{ matrix.electron_arch }}
385+
run: pnpm exec electron-builder --config electron-builder.config.cjs --linux --${{ matrix.electron_arch }}
366386

367387
- name: Prepare artifacts (Windows)
368388
if: runner.os == 'Windows'

fluxer_app/electron-builder.canary.yaml

Lines changed: 0 additions & 114 deletions
This file was deleted.
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/*
2+
* Copyright (C) 2026 Fluxer Contributors
3+
*
4+
* This file is part of Fluxer.
5+
*
6+
* Fluxer is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* Fluxer is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
18+
*/
19+
20+
/** @type {import('electron-builder').Configuration} */
21+
const config = (() => {
22+
const channel = process.env.BUILD_CHANNEL === 'canary' ? 'canary' : 'stable';
23+
const isCanary = channel === 'canary';
24+
25+
const appId = isCanary ? 'app.fluxer.canary' : 'app.fluxer';
26+
const productName = isCanary ? 'Fluxer Canary' : 'Fluxer';
27+
const iconsDir = isCanary ? 'electron-build-resources/icons-canary' : 'electron-build-resources/icons-stable';
28+
29+
const macEntitlements = isCanary
30+
? 'electron-build-resources/entitlements.mac.canary.plist'
31+
: 'electron-build-resources/entitlements.mac.stable.plist';
32+
33+
const macProfile = isCanary
34+
? 'electron-build-resources/profiles/Fluxer_Canary.provisionprofile'
35+
: 'electron-build-resources/profiles/Fluxer.provisionprofile';
36+
37+
const winIconUrl = isCanary
38+
? 'https://fluxerstatic.com/web/icons/desktop/canary/icon.ico'
39+
: 'https://fluxerstatic.com/web/icons/desktop/stable/icon.ico';
40+
41+
const linuxExecutableName = isCanary ? 'fluxercanary' : 'fluxer';
42+
const linuxSynopsis = productName;
43+
const linuxDescription = productName;
44+
45+
return {
46+
appId,
47+
productName,
48+
copyright: 'Copyright (C) 2026 Fluxer Contributors',
49+
50+
artifactName: `fluxer-${channel}-\${version}-\${arch}.\${ext}`,
51+
52+
directories: {
53+
output: 'dist-electron',
54+
buildResources: 'electron-build-resources',
55+
},
56+
57+
files: [
58+
'src-electron/dist/**/*',
59+
'!**/*.map',
60+
'!**/*.md',
61+
'!**/README*',
62+
'!**/readme*',
63+
'!**/CHANGELOG*',
64+
'!**/LICENSE*',
65+
'!**/.github/**',
66+
'!**/docs/**',
67+
'!**/doc/**',
68+
'!**/example/**',
69+
'!**/examples/**',
70+
'!**/test/**',
71+
'!**/tests/**',
72+
'!**/__tests__/**',
73+
'!**/*.ts',
74+
'!**/tsconfig*.json',
75+
],
76+
77+
extraMetadata: {
78+
main: 'src-electron/dist/main/index.js',
79+
type: 'module',
80+
},
81+
82+
asar: true,
83+
compression: 'normal',
84+
85+
asarUnpack: [
86+
'**/*.node',
87+
'**/node_modules/uiohook-napi/**',
88+
'**/node_modules/input-monitoring-check/**',
89+
'**/src-electron/dist/preload/**',
90+
],
91+
92+
extraResources: [
93+
{from: `${iconsDir}/512x512.png`, to: '512x512.png'},
94+
{from: `${iconsDir}/badges`, to: 'badges'},
95+
{from: `${iconsDir}/_compiled/Assets.car`, to: 'Assets.car'},
96+
],
97+
98+
mac: {
99+
category: 'public.app-category.social-networking',
100+
icon: `${iconsDir}/_compiled/AppIcon.icns`,
101+
hardenedRuntime: true,
102+
gatekeeperAssess: false,
103+
entitlements: macEntitlements,
104+
entitlementsInherit: 'electron-build-resources/entitlements.mac.inherit.plist',
105+
provisioningProfile: macProfile,
106+
extendInfo: {
107+
CFBundleIconName: 'AppIcon',
108+
NSMicrophoneUsageDescription: 'Fluxer needs access to your microphone for voice chat.',
109+
NSCameraUsageDescription: 'Fluxer needs access to your camera for video chat.',
110+
NSInputMonitoringUsageDescription: 'Fluxer needs Input Monitoring access for global shortcuts and hotkeys.',
111+
},
112+
notarize: true,
113+
target: [
114+
{target: 'dmg', arch: ['x64', 'arm64']},
115+
{target: 'zip', arch: ['x64', 'arm64']},
116+
],
117+
},
118+
119+
dmg: {
120+
sign: false,
121+
icon: `${iconsDir}/_compiled/AppIcon.icns`,
122+
format: 'UDZO',
123+
contents: [
124+
{x: 130, y: 220},
125+
{x: 410, y: 220, type: 'link', path: '/Applications'},
126+
],
127+
},
128+
129+
win: {
130+
icon: `${iconsDir}/icon.ico`,
131+
target: [{target: 'squirrel'}],
132+
},
133+
134+
squirrelWindows: {
135+
iconUrl: winIconUrl,
136+
},
137+
138+
linux: {
139+
icon: iconsDir,
140+
category: 'Network',
141+
maintainer: 'Fluxer Contributors',
142+
synopsis: linuxSynopsis,
143+
description: linuxDescription,
144+
executableName: linuxExecutableName,
145+
target: ['dir', 'AppImage', 'deb', 'rpm', 'tar.gz'],
146+
mimeTypes: ['x-scheme-handler/fluxer'],
147+
},
148+
149+
protocols: [{name: 'Fluxer', schemes: ['fluxer']}],
150+
};
151+
})();
152+
153+
module.exports = config;

0 commit comments

Comments
 (0)