Repository navigation
Expand file tree
/
Copy pathelectron-builder.yml
More file actions
326 lines (323 loc) · 13.4 KB
/
Copy pathelectron-builder.yml
File metadata and controls
326 lines (323 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# Package layout, installers, hardening. `npm run dist:win`, `dist:mac`, `dist:linux`,
# or the release workflows in .github/workflows. See "Packaging" in the README.
appId: org.bulwarkmail.desktop
productName: Bulwark
copyright: Copyright (C) 2025-2026 Bulwark Project Authors
directories:
output: release
buildResources: build
# Only what has to be a real file comes out of the asar. By default electron-builder takes a
# package's whole folder along with a .node, and its JavaScript would then run from outside.
asar:
smartUnpack: false
# A native module can't load from inside an asar, so the native helper's and policy-watcher's
# .node files go next to it. ASAR integrity does not cover them: it only checks the asar. So
# main.mjs holds their SHA-256 and refuses another file (scripts/addon-pins.mjs). The sharp
# addons in server.asar.unpacked have no such check yet. On macOS the code signature does this,
# in a signed build.
asarUnpack:
- '**/*.node'
# What goes in app.asar. electron-builder adds the production dependencies.
files:
- dist/**/*
# Windows reads these itself: they go in resources/os-icons, below.
- '!dist/os-icons/*.ico'
# Makes the server's code cache at package time (scripts/server-archive.mjs); never run by the app.
- '!dist/code-cache-gen.cjs'
- package.json
# The native helper, per architecture. after-pack.cjs fails without it on Windows and macOS.
- from: native/dist/${platform}-${arch}
to: native
filter:
- bulwark-native.node
# The policy watcher's C++ sources and the headers it was built against: nothing loads them.
- '!**/node_modules/node-addon-api/**'
- '!**/node_modules/@vscode/policy-watcher/src/**'
# What node-gyp leaves beside the policy watcher on Windows.
- '!**/node_modules/@vscode/policy-watcher/build/**/*.{iobj,ipdb,lib,exp,tlog,vcxproj}'
- '!**/node_modules/@vscode/policy-watcher/build/**/*.tlog/**'
# The webmail server, trimmed, guarded and packed for this target by before-pack.cjs.
# As an extra resource so electron-builder lists it for ASAR integrity. Its unpacked files
# go in by after-pack.cjs.
extraResources:
# ADMX, ADML and samples from the webmail, for IT. See scripts/fetch-webmail.mjs.
- from: policies
to: policies
- from: .server-build/${os}-${arch}
to: .
filter:
- server.asar
beforePack: scripts/before-pack.cjs
afterPack: scripts/after-pack.cjs
# Chromium's own strings: the webmail's languages and their regional forms. The rest
# falls back to en-US. Chromium has no Mongolian pack, so that's en-US as well.
electronLanguages: [ar, ca, cs, da, de, en-GB, en-US, es, es-419, et, fa, fr, he, hu, it, ja, ko, lv, nb, nl, pl, pt-BR, pt-PT, ro, ru, sk, th, tr, uk, vi, zh-CN, zh-TW]
# INSTANCE_URL, FORCE_INSTANCE and UPDATE_CHANNEL, the mark that an installer put the app there,
# and the per-user cleanup at uninstall. The NSIS side is build/installer.nsh.
msiProjectCreated: scripts/msi-project.cjs
# policy-watcher is N-API, so what `npm ci` built loads in Electron as it is.
npmRebuild: false
electronFuses:
runAsNode: false
enableCookieEncryption: true
enableNodeOptionsEnvironmentVariable: false
enableNodeCliInspectArguments: false
enableEmbeddedAsarIntegrityValidation: true
onlyLoadAppFromAsar: true
grantFileProtocolExtraPrivileges: false
# electron-updater reads this from app-update.yml. A prerelease on GitHub is the beta
# channel: its own release, with a latest.yml of its own in it. CI builds with
# `--publish never` and uploads in a separate job, so no build step holds a write token.
publish:
provider: github
owner: bulwarkmail
repo: desktop
win:
# Signing: CI passes azureSignOptions (Azure Artifact Signing, publisher "Rath & Blume GbR")
# on the command line when it has the AZURE_* secrets, see the windows job in release.yml.
# Not here: electron-builder goes for Azure as soon as they're set, and a local build has no
# credentials. The publisher name goes into app-update.yml, and electron-updater then refuses
# an installer that isn't signed by that name. Never change it without listing the old name
# as well, or every signed install stops updating. A local build is unsigned and names none.
icon: build/icon.ico
executableName: Bulwark
# The jump list's icons. Windows reads them itself, after the app set them, so they have to
# be real files and not in the asar. The package guard checks each is there with every size.
extraResources:
- from: assets/os
to: os-icons
filter:
- task-*.ico
# The Files drive's icon in Explorer: the exe's own, as a file (scripts/task-icons.mjs).
- from: build/icon.ico
to: os-icons/bulwark.ico
target:
- target: nsis
arch: [x64, arm64]
- target: msi
arch: [x64, arm64]
# Windows registers its URL schemes and file types at run time (os-default-app.ts) and
# not through these: electron-builder's NSIS writes them as HKCU's default for the type,
# which takes mailto: and .eml from whoever had them. Which app is the default stays the
# user's choice there.
nsis:
# Per-user, no elevation. This is the install electron-updater can replace by itself.
oneClick: true
perMachine: false
packElevateHelper: false
# One installer per architecture, both named in latest.yml. electron-updater picks by
# process.arch in the file name. The default would put both in one big download.
buildUniversalInstaller: false
# An update downloads only the blocks that changed: the 7z inside is packed file by file
# (not solid, 1 MB dictionary) and a blockmap goes next to the installer, which the release
# workflow publishes (src/main/update-rules.ts differentialDownloads). Measured on x64: the
# installer is 144 MB instead of 126 MB, and unpacks in 2.5 s instead of 8 s, since a solid
# 7z decodes as one stream. A version-only update came down as 1.1 MB. `compression: store`
# unpacks no faster overall (its 471 MB are copied out of the installer first).
differentialPackage: true
artifactName: Bulwark-Setup-${version}-${arch}.${ext}
shortcutName: Bulwark
uninstallDisplayName: Bulwark
createDesktopShortcut: false
createStartMenuShortcut: true
runAfterFinish: true
deleteAppDataOnUninstall: false
# The app's languages where NSIS has them, and Swedish and Finnish, which it had before. Not
# Farsi: electron-builder asks NSIS for "Persian", and NSIS calls it Farsi. Each needs the
# window's strings in build/installer-strings.nsh, or makensis fails.
installerLanguages: [en_US, de_DE, fr_FR, es_ES, zh_CN, zh_TW, ja_JP, ko_KR, it_IT, nl_NL, da_DK, sv_SE, nb_NO, fi_FI, ru_RU, pt_PT, pt_BR, pl_PL, uk_UA, cs_CZ, sk_SK, hu_HU, ar_SA, tr_TR, th_TH, vi_VN, ca_ES, et_EE, he_IL, lv_LV, mn_MN, ro_RO]
# The window (build/installer-theme.nsh) and the switches.
include: build/installer.nsh
msi:
# Per-machine, for IT. electron-updater can't replace it: see "Updates" in the README.
# The upgrade code stays the same forever, it's how a new MSI replaces the old one.
oneClick: true
perMachine: true
runAfterFinish: false
upgradeCode: 7E4C3B52-6F0A-4D8E-9B31-2C5D8A1F6E47
artifactName: Bulwark-${version}-${arch}.${ext}
shortcutName: Bulwark
createDesktopShortcut: false
createStartMenuShortcut: true
mac:
# Hardened runtime and notarization only come into play when CI signs. electron-builder
# signs when CSC_LINK and CSC_KEY_PASSWORD are set, and notarizes when APPLE_API_KEY,
# APPLE_API_KEY_ID and APPLE_API_ISSUER (or APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD and
# APPLE_TEAM_ID) are. Unused so far.
hardenedRuntime: true
gatekeeperAssess: false
entitlements: build/entitlements.mac.plist
entitlementsInherit: build/entitlements.mac.plist
icon: build/icon.icns
category: public.app-category.productivity
# electron-updater downloads the zip. A universal build merges an x64 and an arm64 tree.
# The server's sharp binaries for both architectures sit in both trees (after-pack.cjs),
# so they are the same file on both sides and must not go through lipo. Native modules
# in app.asar (the native helper) are built per architecture, and lipo merges those.
x64ArchFiles: '**/@img/**'
target:
- target: dmg
arch: universal
- target: zip
arch: universal
artifactName: Bulwark-${version}-${arch}.${ext}
protocols:
- name: Mail
schemes: [mailto]
role: Editor
- name: Calendar
schemes: [webcal, webcals]
role: Viewer
- name: Bulwark
schemes: [bulwark]
role: Viewer
fileAssociations:
- ext: eml
name: E-mail message
role: Viewer
- ext: ics
name: Calendar file
role: Viewer
- ext: vcf
name: Contact card
role: Viewer
# "Open With" for documents and pictures, to attach them to a new message. Alternate: listed,
# never the default (os-rules.ts OPEN_WITH_EXTENSIONS has the same list for Windows).
- ext: [pdf, doc, docx, xls, xlsx, ppt, pptx, odt, ods, odp, rtf, txt, csv, jpg, jpeg, png, gif, webp, heic, bmp, tif, tiff, svg, zip]
name: Document
role: Viewer
rank: Alternate
dmg:
sign: false
# From assets/dmg-background.svg, by scripts/make-dmg-background.mjs. The @2x next to it is
# found by name. Its arrow runs between electron-builder's default icon places, so this sets
# no contents.
background: build/dmg-background.png
linux:
icon: build/icons
category: Network;Email
maintainer: Bulwark Mail <dev@bulwarkmail.org>
vendor: Bulwark Mail
synopsis: Bulwark Mail for the desktop
executableName: bulwark
# The binary and the .desktop file named alike: the window's app_id follows desktopName
# in package.json. os-integration needs the same two for Unity's count.
syncDesktopName: true
# electron-builder adds %U to Exec and fills MimeType from these. %U, not %F: the same entry
# takes mailto: and webcal: links, and a file manager hands several files over as file: URLs
# in one start, which os-rules.ts parseArgv reads as files.
# The documents and pictures after the line only put Bulwark in "Open With", to attach them:
# nothing here sets a default (os-rules.ts OPEN_WITH_EXTENSIONS has the same list for Windows).
mimeTypes:
- x-scheme-handler/mailto
- x-scheme-handler/webcal
- x-scheme-handler/webcals
- x-scheme-handler/bulwark
- message/rfc822
- text/calendar
- text/vcard
- text/x-vcard
- application/pdf
- application/msword
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- application/vnd.ms-excel
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- application/vnd.ms-powerpoint
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- application/vnd.oasis.opendocument.text
- application/vnd.oasis.opendocument.spreadsheet
- application/vnd.oasis.opendocument.presentation
- application/rtf
- text/plain
- text/csv
- image/jpeg
- image/png
- image/gif
- image/webp
- image/heic
- image/bmp
- image/tiff
- image/svg+xml
- application/zip
fileAssociations:
- ext: eml
mimeType: message/rfc822
- ext: ics
mimeType: text/calendar
- ext: vcf
mimeType: text/vcard
desktop:
entry:
Actions: NewMessage;Inbox;Calendar;Contacts;
# Icons by their freedesktop names: the desktop's own theme draws them, where it shows any.
desktopActions:
NewMessage:
Name: New message
Name[de]: Neue Nachricht
Exec: bulwark bulwark://new
Icon: mail-message-new
Inbox:
Name: Inbox
Name[de]: Posteingang
Exec: bulwark bulwark://inbox
Icon: mail-folder-inbox
Calendar:
Name: Calendar
Name[de]: Kalender
Exec: bulwark bulwark://calendar
Icon: x-office-calendar
Contacts:
Name: Contacts
Name[de]: Kontakte
Exec: bulwark bulwark://contacts
Icon: x-office-address-book
# No architectures here: a target that names them builds them whatever the command line
# says, and each release job runs on the machine it builds for.
target:
- AppImage
- deb
- rpm
appImage:
artifactName: Bulwark-${version}-${arch}.${ext}
# Never add --no-sandbox. AppRun still adds it by itself where user namespaces are
# blocked, and then the app refuses to run: see src/main/sandbox-check.ts.
executableArgs: []
# Depends: electron-builder's list, which a list here replaces, and what Electron's binary links
# that a minimal system lacks (`readelf -d electron`): ALSA, and GBM with the DRM library under
# it. Without ALSA the app doesn't start on a minimal Ubuntu. Ubuntu 24.04 renamed it to
# libasound2t64; 22.04 and Debian 12 still have libasound2. test/linux-packages.spec.ts.
deb:
packageName: bulwark
artifactName: bulwark_${version}_${arch}.${ext}
depends:
- libgtk-3-0
- libnotify4
- libnss3
- libxss1
- libxtst6
- xdg-utils
- libatspi2.0-0
- libuuid1
- libsecret-1-0
- libasound2t64 | libasound2
- libgbm1
- libdrm2
rpm:
packageName: bulwark
# The same for Fedora and openSUSE names. A list here replaces electron-builder's.
depends:
- gtk3
- libnotify
- nss
- libXScrnSaver
- (libXtst or libXtst6)
- xdg-utils
- at-spi2-core
- (libuuid or libuuid1)
- (libsecret or libsecret-1-0)
- (alsa-lib or libasound2)
- (mesa-libgbm or libgbm1)
- (libdrm or libdrm2)
# Otherwise the package doesn't own its folders, and removing it leaves them empty.
fpm: ['--directories', '/opt/Bulwark']
artifactName: bulwark-${version}.${arch}.${ext}