fix(app): reconcile electron builder configs (#11)

This commit is contained in:
hampus-fluxer 2026-01-03 17:30:08 +01:00 committed by GitHub
parent 3dec3895d5
commit 7782bb1ba5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 176 additions and 231 deletions

View File

@ -278,7 +278,27 @@ jobs:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: pnpm exec electron-builder --config electron-builder.yaml --mac --${{ matrix.electron_arch }}
run: pnpm exec electron-builder --config electron-builder.config.cjs --mac --${{ matrix.electron_arch }}
- name: Verify macOS bundle ID (fail fast if wrong channel)
if: matrix.platform == 'macos'
working-directory: ${{ env.APP_WORKDIR }}
shell: bash
env:
BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: |
set -euo pipefail
DIST="dist-electron"
ZIP="$(ls -1 "$DIST"/*"${{ matrix.electron_arch }}"*.zip | head -n1)"
tmp="$(mktemp -d)"
ditto -xk "$ZIP" "$tmp"
APP="$(find "$tmp" -maxdepth 2 -name "*.app" -print -quit)"
BID=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$APP/Contents/Info.plist")
expected="app.fluxer"
if [[ "${BUILD_CHANNEL:-stable}" == "canary" ]]; then expected="app.fluxer.canary"; fi
echo "Bundle id in zip: $BID (expected: $expected)"
test "$BID" = "$expected"
- name: Build Electron app (Windows)
if: matrix.platform == 'windows'
@ -289,7 +309,7 @@ jobs:
TMP: C:\t
SQUIRREL_TEMP: C:\sq
ELECTRON_BUILDER_CACHE: C:\ebcache
run: pnpm exec electron-builder --config electron-builder.yaml --win --${{ matrix.electron_arch }}
run: pnpm exec electron-builder --config electron-builder.config.cjs --win --${{ matrix.electron_arch }}
- name: Analyze Squirrel nupkg for long paths
if: matrix.platform == 'windows'
@ -362,7 +382,7 @@ jobs:
env:
BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
USE_SYSTEM_FPM: true
run: pnpm exec electron-builder --config electron-builder.yaml --linux --${{ matrix.electron_arch }}
run: pnpm exec electron-builder --config electron-builder.config.cjs --linux --${{ matrix.electron_arch }}
- name: Prepare artifacts (Windows)
if: runner.os == 'Windows'

View File

@ -1,114 +0,0 @@
appId: app.fluxer.canary
productName: Fluxer Canary
copyright: Copyright (C) 2026 Fluxer Contributors
artifactName: fluxer-${version}-${arch}.${ext}
directories:
output: dist-electron
buildResources: electron-build-resources
files:
- src-electron/dist/**/*
- "!**/*.map"
- "!**/*.md"
- "!**/README*"
- "!**/readme*"
- "!**/CHANGELOG*"
- "!**/LICENSE*"
- "!**/.github/**"
- "!**/docs/**"
- "!**/doc/**"
- "!**/example/**"
- "!**/examples/**"
- "!**/test/**"
- "!**/tests/**"
- "!**/__tests__/**"
- "!**/*.ts"
- "!**/tsconfig*.json"
extraMetadata:
main: src-electron/dist/main/index.js
type: module
asar: true
compression: normal
asarUnpack:
- "**/*.node"
- "**/node_modules/uiohook-napi/**"
- "**/node_modules/input-monitoring-check/**"
- "**/src-electron/dist/preload/**"
extraResources:
- from: electron-build-resources/icons-canary/512x512.png
to: 512x512.png
- from: electron-build-resources/icons-canary/badges
to: badges
- from: electron-build-resources/icons-canary/_compiled/Assets.car
to: Assets.car
mac:
category: public.app-category.social-networking
icon: electron-build-resources/icons-canary/_compiled/AppIcon.icns
hardenedRuntime: true
gatekeeperAssess: false
entitlements: electron-build-resources/entitlements.mac.canary.plist
entitlementsInherit: electron-build-resources/entitlements.mac.inherit.plist
provisioningProfile: electron-build-resources/profiles/Fluxer_Canary.provisionprofile
extendInfo:
CFBundleIconName: AppIcon
NSMicrophoneUsageDescription: Fluxer needs access to your microphone for voice chat.
NSCameraUsageDescription: Fluxer needs access to your camera for video chat.
NSInputMonitoringUsageDescription: Fluxer needs Input Monitoring access for global shortcuts and hotkeys.
notarize: true
target:
- target: dmg
arch:
- x64
- arm64
- target: zip
arch:
- x64
- arm64
dmg:
sign: false
icon: electron-build-resources/icons-canary/_compiled/AppIcon.icns
format: UDZO
contents:
- x: 130
y: 220
- x: 410
y: 220
type: link
path: /Applications
win:
icon: electron-build-resources/icons-canary/icon.ico
target:
- squirrel
squirrelWindows:
iconUrl: https://fluxerstatic.com/web/icons/desktop/canary/icon.ico
linux:
icon: electron-build-resources/icons-canary
category: Network
maintainer: Fluxer Contributors
synopsis: Fluxer Canary
description: Fluxer Canary
executableName: fluxercanary
target:
- dir
- AppImage
- deb
- rpm
- tar.gz
mimeTypes:
- x-scheme-handler/fluxer
protocols:
- name: Fluxer
schemes:
- fluxer

View File

@ -0,0 +1,153 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
/** @type {import('electron-builder').Configuration} */
const config = (() => {
const channel = process.env.BUILD_CHANNEL === 'canary' ? 'canary' : 'stable';
const isCanary = channel === 'canary';
const appId = isCanary ? 'app.fluxer.canary' : 'app.fluxer';
const productName = isCanary ? 'Fluxer Canary' : 'Fluxer';
const iconsDir = isCanary ? 'electron-build-resources/icons-canary' : 'electron-build-resources/icons-stable';
const macEntitlements = isCanary
? 'electron-build-resources/entitlements.mac.canary.plist'
: 'electron-build-resources/entitlements.mac.stable.plist';
const macProfile = isCanary
? 'electron-build-resources/profiles/Fluxer_Canary.provisionprofile'
: 'electron-build-resources/profiles/Fluxer.provisionprofile';
const winIconUrl = isCanary
? 'https://fluxerstatic.com/web/icons/desktop/canary/icon.ico'
: 'https://fluxerstatic.com/web/icons/desktop/stable/icon.ico';
const linuxExecutableName = isCanary ? 'fluxercanary' : 'fluxer';
const linuxSynopsis = productName;
const linuxDescription = productName;
return {
appId,
productName,
copyright: 'Copyright (C) 2026 Fluxer Contributors',
artifactName: `fluxer-${channel}-\${version}-\${arch}.\${ext}`,
directories: {
output: 'dist-electron',
buildResources: 'electron-build-resources',
},
files: [
'src-electron/dist/**/*',
'!**/*.map',
'!**/*.md',
'!**/README*',
'!**/readme*',
'!**/CHANGELOG*',
'!**/LICENSE*',
'!**/.github/**',
'!**/docs/**',
'!**/doc/**',
'!**/example/**',
'!**/examples/**',
'!**/test/**',
'!**/tests/**',
'!**/__tests__/**',
'!**/*.ts',
'!**/tsconfig*.json',
],
extraMetadata: {
main: 'src-electron/dist/main/index.js',
type: 'module',
},
asar: true,
compression: 'normal',
asarUnpack: [
'**/*.node',
'**/node_modules/uiohook-napi/**',
'**/node_modules/input-monitoring-check/**',
'**/src-electron/dist/preload/**',
],
extraResources: [
{from: `${iconsDir}/512x512.png`, to: '512x512.png'},
{from: `${iconsDir}/badges`, to: 'badges'},
{from: `${iconsDir}/_compiled/Assets.car`, to: 'Assets.car'},
],
mac: {
category: 'public.app-category.social-networking',
icon: `${iconsDir}/_compiled/AppIcon.icns`,
hardenedRuntime: true,
gatekeeperAssess: false,
entitlements: macEntitlements,
entitlementsInherit: 'electron-build-resources/entitlements.mac.inherit.plist',
provisioningProfile: macProfile,
extendInfo: {
CFBundleIconName: 'AppIcon',
NSMicrophoneUsageDescription: 'Fluxer needs access to your microphone for voice chat.',
NSCameraUsageDescription: 'Fluxer needs access to your camera for video chat.',
NSInputMonitoringUsageDescription: 'Fluxer needs Input Monitoring access for global shortcuts and hotkeys.',
},
notarize: true,
target: [
{target: 'dmg', arch: ['x64', 'arm64']},
{target: 'zip', arch: ['x64', 'arm64']},
],
},
dmg: {
sign: false,
icon: `${iconsDir}/_compiled/AppIcon.icns`,
format: 'UDZO',
contents: [
{x: 130, y: 220},
{x: 410, y: 220, type: 'link', path: '/Applications'},
],
},
win: {
icon: `${iconsDir}/icon.ico`,
target: [{target: 'squirrel'}],
},
squirrelWindows: {
iconUrl: winIconUrl,
},
linux: {
icon: iconsDir,
category: 'Network',
maintainer: 'Fluxer Contributors',
synopsis: linuxSynopsis,
description: linuxDescription,
executableName: linuxExecutableName,
target: ['dir', 'AppImage', 'deb', 'rpm', 'tar.gz'],
mimeTypes: ['x-scheme-handler/fluxer'],
},
protocols: [{name: 'Fluxer', schemes: ['fluxer']}],
};
})();
module.exports = config;

View File

@ -1,114 +0,0 @@
appId: app.fluxer
productName: Fluxer
copyright: Copyright (C) 2026 Fluxer Contributors
artifactName: fluxer-${version}-${arch}.${ext}
directories:
output: dist-electron
buildResources: electron-build-resources
files:
- src-electron/dist/**/*
- "!**/*.map"
- "!**/*.md"
- "!**/README*"
- "!**/readme*"
- "!**/CHANGELOG*"
- "!**/LICENSE*"
- "!**/.github/**"
- "!**/docs/**"
- "!**/doc/**"
- "!**/example/**"
- "!**/examples/**"
- "!**/test/**"
- "!**/tests/**"
- "!**/__tests__/**"
- "!**/*.ts"
- "!**/tsconfig*.json"
extraMetadata:
main: src-electron/dist/main/index.js
type: module
asar: true
compression: normal
asarUnpack:
- "**/*.node"
- "**/node_modules/uiohook-napi/**"
- "**/node_modules/input-monitoring-check/**"
- "**/src-electron/dist/preload/**"
extraResources:
- from: electron-build-resources/icons-stable/512x512.png
to: 512x512.png
- from: electron-build-resources/icons-stable/badges
to: badges
- from: electron-build-resources/icons-stable/_compiled/Assets.car
to: Assets.car
mac:
category: public.app-category.social-networking
icon: electron-build-resources/icons-stable/_compiled/AppIcon.icns
hardenedRuntime: true
gatekeeperAssess: false
entitlements: electron-build-resources/entitlements.mac.stable.plist
entitlementsInherit: electron-build-resources/entitlements.mac.inherit.plist
provisioningProfile: electron-build-resources/profiles/Fluxer.provisionprofile
extendInfo:
CFBundleIconName: AppIcon
NSMicrophoneUsageDescription: Fluxer needs access to your microphone for voice chat.
NSCameraUsageDescription: Fluxer needs access to your camera for video chat.
NSInputMonitoringUsageDescription: Fluxer needs Input Monitoring access for global shortcuts and hotkeys.
notarize: true
target:
- target: dmg
arch:
- x64
- arm64
- target: zip
arch:
- x64
- arm64
dmg:
sign: false
icon: electron-build-resources/icons-stable/_compiled/AppIcon.icns
format: UDZO
contents:
- x: 130
y: 220
- x: 410
y: 220
type: link
path: /Applications
win:
icon: electron-build-resources/icons-stable/icon.ico
target:
- squirrel
squirrelWindows:
iconUrl: https://fluxerstatic.com/web/icons/desktop/stable/icon.ico
linux:
icon: electron-build-resources/icons-stable
category: Network
maintainer: Fluxer Contributors
synopsis: Fluxer
description: Fluxer
executableName: fluxer
target:
- dir
- AppImage
- deb
- rpm
- tar.gz
mimeTypes:
- x-scheme-handler/fluxer
protocols:
- name: Fluxer
schemes:
- fluxer