-
Notifications
You must be signed in to change notification settings - Fork 291
/
build.sh
executable file
·638 lines (544 loc) · 20.7 KB
/
build.sh
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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
#!/bin/bash
set -euo pipefail
cd $(dirname $0)/
# Print green
function log {
echo -e "build.sh:" '\033[0;32m' "$@" '\033[0m'
}
# Print red and exit
function error {
echo -e "build.sh:" '\033[0;31m' "Error:" "$@" '\033[0m'
exit 1
}
# yq is used to process the toml file.
if ! [ -x "$(command -v yq)" ]; then
error "yq not installed. See https://github.com/mikefarah/yq/#install"
fi
dist_dir_name=dist
host_os=$(uname -s)
host_arch=$(uname -m)
case $host_os in
Linux)
host_os="linux"
;;
Darwin)
host_os="mac"
;;
MINGW*)
host_os="windows"
;;
esac
host="${host_os}-${host_arch}"
target=$host
build_all=0
publish=0
skip_packaging=0
skip_signing=0
skip_bundling=0
skip_notary=0
target_node=18
while [[ "$#" -gt 0 ]]; do
case $1 in
-h|--help)
echo "Usage:"
echo "--all # Build all targets. Only works from a Apple Silicon host"
echo "--publish # make the built packages available online"
echo "--skip-bundling # skip bundling JS code into binary. Packaging will reuse already built binaries"
echo "--skip-packaging # skip packaging operations (including signing)"
echo "--skip-signing # do not sign the binaries"
echo "--skip-notary # do not send pkg to Apple's notary service"
echo "--force-node10 # use node 10. Automatic for win7-* and *-i686"
echo "--target <os-arch> # os: linux / mac / windows / win7, arch: x86_64 / i686 / arm64"
exit 0
;;
--all) build_all=1 ;;
--publish) publish=1 ;;
--skip-bundling) skip_bundling=1 ;;
--skip-packaging) skip_packaging=1 ; skip_signing=1 ; skip_notary=1 ;;
--skip-signing) skip_signing=1 ; skip_notary=1 ;;
--force-node10) target_node=10 ;;
--skip-notary) skip_notary=1 ;;
--target) target="$2"; shift ;;
*) error "Unknown parameter passed: $1" ;;
esac
shift
done
case $target in
linux-i686 | \
linux-aarch64 | \
linux-x86_64 | \
windows-x86_64 | \
windows-i686 | \
win7-x86_64 | \
win7-i686 | \
mac13-x86_64 | \
mac-x86_64 | \
mac-arm64)
;;
*)
error "Unsupported target: $target"
;;
esac
target_os=$(echo $target | cut -f1 -d-)
target_arch=$(echo $target | cut -f2 -d-)
target_dist_dir_rel=$dist_dir_name/$target_os/$target_arch
target_dist_dir=$PWD/$target_dist_dir_rel
dist_dir=$PWD/$dist_dir_name
if [ $target_os == "win7" ]; then
target_node=10
fi
if [ $target_arch == "i686" ]; then
target_node=10
fi
if ! [ -x "$(command -v node)" ]; then
error "Node not installed"
fi
if [ $target_node == 10 ]; then
if [[ $(node -v) != v10.* ]]
then
error "Wrong version of Node (expected v10)"
fi
else
if [[ $(node -v) != v18.* ]]
then
error "Wrong version of Node (expected v18)"
fi
fi
if ! [ -x "$(command -v esbuild)" ]; then
log "Installing esbuild"
npm install -g esbuild
fi
if ! [ -x "$(command -v pkg)" ]; then
log "Installing pkg"
if [ $target_node == 10 ]; then
npm install -g [email protected]
else
npm install -g pkg
fi
fi
if [ $target_node == 10 ]; then
if [[ $(pkg -v) != 4.4.9 ]]
then
error "Wrong version of Pkg (expected 4.4.9)"
fi
fi
if ! [ -x "$(command -v ejs)" ]; then
log "Installing ejs"
npm install -g ejs
fi
if [ ! -d "app/node_modules" ]; then
(cd app/ ; npm install)
fi
# Extract all toml data into shell variables.
eval $(yq ./config.toml -o shell)
node_arch=$target_arch
node_os=$target_os
deb_arch=$target_arch
if [[ $target_os == "win7" || $target_os == "windows" ]];
then
exe_extension=".exe"
else
exe_extension=""
fi
filepicker_target=filepicker-$target$exe_extension
ffmpeg_target=ffmpeg-$package_ffmpeg_build_version-$target
ffmpeg_target_dir=ffmpeg-$target
if [ $target_os == "win7" ]; then
node_os="windows"
ffmpeg_target=ffmpeg-$package_ffmpeg_build_version-windows-$target_arch
ffmpeg_target_dir=ffmpeg-windows-$target_arch
filepicker_target=filepicker-windows-$target_arch$exe_extension
fi
if [ $target_os == "mac13" ]; then
node_os="mac"
filepicker_target=filepicker-mac-$target_arch$exe_extension
fi
if [ $target == "linux-aarch64" ]; then
node_arch="arm64"
deb_arch="arm64"
fi
if [ $target_arch == "i686" ]; then
node_arch="x86"
fi
if [ $target == "linux-i686" ]; then
deb_arch="i386"
fi
if [ $target == "linux-x86_64" ]; then
deb_arch="amd64"
fi
if [ $publish == 1 ]; then
files=(
"assets/install.sh"
"dist/linux/i686/$package_binary_name-linux-i686.tar.bz2"
"dist/linux/i686/$package_binary_name-noffmpeg-linux-i686.tar.bz2"
"dist/linux/i686/$package_binary_name-linux-i686.deb"
"dist/linux/i686/$package_binary_name-noffmpeg-linux-i686.deb"
"dist/linux/x86_64/$package_binary_name-linux-x86_64.tar.bz2"
"dist/linux/x86_64/$package_binary_name-noffmpeg-linux-x86_64.tar.bz2"
"dist/linux/x86_64/$package_binary_name-linux-x86_64.deb"
"dist/linux/x86_64/$package_binary_name-noffmpeg-linux-x86_64.deb"
"dist/linux/aarch64/$package_binary_name-linux-aarch64.tar.bz2"
"dist/linux/aarch64/$package_binary_name-noffmpeg-linux-aarch64.tar.bz2"
"dist/linux/aarch64/$package_binary_name-linux-aarch64.deb"
"dist/linux/aarch64/$package_binary_name-noffmpeg-linux-aarch64.deb"
"dist/mac/x86_64/$package_binary_name-mac-x86_64.dmg"
"dist/mac/x86_64/$package_binary_name-mac-x86_64-installer.pkg"
"dist/mac/arm64/$package_binary_name-mac-arm64.dmg"
"dist/mac/arm64/$package_binary_name-mac-arm64-installer.pkg"
"dist/mac13/x86_64/$package_binary_name-mac13-x86_64.dmg"
"dist/mac13/x86_64/$package_binary_name-mac13-x86_64-installer.pkg"
"dist/win7/i686/$package_binary_name-win7-i686-installer.exe"
"dist/win7/x86_64/$package_binary_name-win7-x86_64-installer.exe"
"dist/windows/i686/$package_binary_name-windows-i686-installer.exe"
"dist/windows/x86_64/$package_binary_name-windows-x86_64-installer.exe"
)
checksums=dist/checksums_v${meta_version}.json
echo "\"$meta_version\": {" > $checksums
for file in "${files[@]}"; do
echo " \"$(basename $file)\": \"$(sha256sum $file | cut -f 1 -d " ")\"," >> $checksums
done
echo "}" >> $checksums
gh release upload v$meta_version $checksums --clobber
gh release upload v$meta_version "${files[@]}" --clobber
exit 0
fi
if [ $build_all == 1 ]; then
if [ $host != "mac-arm64" ]; then
error "Can only build all targets on Apple Silicon"
fi
targets=("mac-arm64" "linux-x86_64" "linux-aarch64" "windows-x86_64")
for target in "${targets[@]}"
do
log "Building for $target"
./build.sh --target $target
done
# Ensuring Rosetta is installed
softwareupdate --install-rosetta --agree-to-license
log "Building for mac-x86_64"
arch -x86_64 ./build.sh
log "Building for mac13-x86_64"
arch -x86_64 ./build.sh --target mac13-x86_64
fnm use 10
# FIXME: linux-i686 can't be built under Mac as it needs to Node 10.
# To compile for linux-i686 build from a Linux i686 system.
targets=("win7-i686" "win7-x86_64" "windows-i686")
for target in "${targets[@]}"
do
log "Building for $target"
./build.sh --target $target
done
fnm use 18
exit 0
fi
## ACTUALLY BUILDING
log "Building for $target on $host"
log "Skipping bundling: $skip_bundling"
log "Skipping packaging: $skip_packaging"
log "Skipping signing: $skip_signing"
log "Skipping notary: $skip_notary"
log "Node version: $target_node"
log "Installation destination: $target_dist_dir_rel"
rm -rf $target_dist_dir
mkdir -p $target_dist_dir
# The json file is a copy of the toml + target information.
# Used for .ejs files and in JS code (importing config.json).
log "Creating config.json"
yq . -o yaml ./config.toml | \
yq e ".target.os = \"$target_os\"" |\
yq e ".target.arch = \"$target_arch\"" |\
yq e ".target.node = \"$target_node\"" -o json \
> $target_dist_dir/config.json
out_deb_file="$package_binary_name-$target.deb"
out_bz2_file="$package_binary_name-$target.tar.bz2"
out_noffmpeg_deb_file="$package_binary_name-noffmpeg-$target.deb"
out_noffmpeg_bz2_file="$package_binary_name-noffmpeg-$target.tar.bz2"
out_pkg_file="$package_binary_name-$target-installer.pkg"
out_dmg_file="$package_binary_name-$target.dmg"
out_win_file="$package_binary_name-$target-installer.exe"
if [ ! $skip_bundling == 1 ]; then
# This could be done by pkg directly, but esbuild is more tweakable.
# - hardcoding import.meta.url because the `open` module requires it.
# - faking an electron module because `got` requires on (but it's never used)
log "Bundling JS code into single file"
if [ $target_node == 10 ]; then
declare -a opts=("--target=es6" "--alias:open=open2")
else
declare -a opts=("--target=esnext" \
"--banner:js=const _importMetaUrl=require('url').pathToFileURL(__filename)" \
"--define:import.meta.url=_importMetaUrl")
fi
NODE_PATH=app/src:$target_dist_dir esbuild ./app/src/main.js \
"${opts[@]}" \
--format=cjs \
--bundle --platform=node \
--tree-shaking=true \
--alias:electron=electron2 \
--outfile=$dist_dir/bundled.js
if [ $target_node == 10 ]; then
declare -a opts=("$dist_dir/bundled.js" "--no-bytecode" "--public")
else
declare -a opts=("$dist_dir/bundled.js")
fi
log "Bundling Node binary with code"
pkg "${opts[@]}" \
--target node$target_node-$node_os-$node_arch \
--output $target_dist_dir/$package_binary_name$exe_extension
else
log "Skipping bundling"
fi
if [[ ! -f $dist_dir/$filepicker_target ]]; then
log "Retrieving filepicker"
filepicker_url_base="https://github.com/paulrouget/static-filepicker/releases/download/"
filepicker_url=$filepicker_url_base/v$package_filepicker_build_version/$filepicker_target
wget -c $filepicker_url -O $dist_dir/$filepicker_target
chmod +x $dist_dir/$filepicker_target
fi
cp $dist_dir/$filepicker_target $target_dist_dir/filepicker$exe_extension
if [[ ! -d $dist_dir/$ffmpeg_target_dir ]]; then
log "Retrieving ffmpeg"
ffmpeg_url_base="https://github.com/aclap-dev/ffmpeg-static-builder/releases/download/"
ffmpeg_url=$ffmpeg_url_base/v$package_ffmpeg_build_version/$ffmpeg_target.tar.bz2
ffmpeg_tarball=$dist_dir/$ffmpeg_target.tar.bz2
wget --show-progress -c -O $ffmpeg_tarball $ffmpeg_url
(cd $dist_dir && tar -xf $ffmpeg_tarball)
fi
cp $dist_dir/$ffmpeg_target_dir/ffmpeg$exe_extension \
$dist_dir/$ffmpeg_target_dir/ffprobe$exe_extension \
$target_dist_dir/
if [ ! $skip_packaging == 1 ]; then
log "Packaging v$meta_version for $target"
# ===============================================
# LINUX
# ===============================================
if [ $target_os == "linux" ]; then
mkdir -p $target_dist_dir/deb/opt/$package_binary_name
mkdir -p $target_dist_dir/deb/DEBIAN
# --------------------------------
# Variation: No ffmpeg shipped
# --------------------------------
cp LICENSE.txt README.md app/node_modules/open/xdg-open \
$target_dist_dir/filepicker \
$target_dist_dir/$package_binary_name \
$target_dist_dir/deb/opt/$package_binary_name
yq ".package.deb" ./config.toml -o yaml | \
yq e ".package = \"${meta_id}.noffmpeg\"" |\
yq e ".conflicts = \"${meta_id}\"" |\
yq e ".description = \"${meta_description} (with system ffmpeg)\"" |\
yq e ".architecture = \"${deb_arch}\"" |\
yq e ".depends = \"ffmpeg\"" |\
yq e ".version = \"${meta_version}\"" > $target_dist_dir/deb/DEBIAN/control
ejs -f $target_dist_dir/config.json ./assets/linux/prerm.ejs \
> $target_dist_dir/deb/DEBIAN/prerm
chmod +x $target_dist_dir/deb/DEBIAN/prerm
ejs -f $target_dist_dir/config.json ./assets/linux/postinst.ejs \
> $target_dist_dir/deb/DEBIAN/postinst
chmod +x $target_dist_dir/deb/DEBIAN/postinst
log "Building noffmpeg.deb file"
dpkg-deb --build $target_dist_dir/deb $target_dist_dir/$out_noffmpeg_deb_file
rm -rf $target_dist_dir/$package_binary_name-$meta_version
mkdir $target_dist_dir/$package_binary_name-$meta_version
cp $target_dist_dir/deb/opt/$package_binary_name/* \
$target_dist_dir/$package_binary_name-$meta_version
log "Building .tar.bz2 file"
tar_extra=""
if [ $host_os == "mac" ]; then
tar_extra="--no-xattrs --no-mac-metadata"
fi
(cd $target_dist_dir && tar -cvjS $tar_extra -f $out_noffmpeg_bz2_file $package_binary_name-$meta_version)
# --------------------------------
# Variation: ffmpeg binary shipped
# --------------------------------
rm -rf $target_dist_dir/deb
mkdir -p $target_dist_dir/deb/opt/$package_binary_name
mkdir -p $target_dist_dir/deb/DEBIAN
cp LICENSE.txt README.md app/node_modules/open/xdg-open \
$target_dist_dir/$package_binary_name \
$target_dist_dir/filepicker \
$target_dist_dir/ffmpeg \
$target_dist_dir/ffprobe \
$target_dist_dir/deb/opt/$package_binary_name
yq ".package.deb" ./config.toml -o yaml | \
yq e ".package = \"${meta_id}\"" |\
yq e ".conflicts = \"${meta_id}.noffmpeg\"" |\
yq e ".description = \"${meta_description} (with builtin ffmpeg.)\"" |\
yq e ".architecture = \"${deb_arch}\"" |\
yq e ".version = \"${meta_version}\"" > $target_dist_dir/deb/DEBIAN/control
ejs -f $target_dist_dir/config.json ./assets/linux/prerm.ejs \
> $target_dist_dir/deb/DEBIAN/prerm
chmod +x $target_dist_dir/deb/DEBIAN/prerm
ejs -f $target_dist_dir/config.json ./assets/linux/postinst.ejs \
> $target_dist_dir/deb/DEBIAN/postinst
chmod +x $target_dist_dir/deb/DEBIAN/postinst
log "Building .deb file"
dpkg-deb --build $target_dist_dir/deb $target_dist_dir/$out_deb_file
rm -rf $target_dist_dir/$package_binary_name-$meta_version
mkdir $target_dist_dir/$package_binary_name-$meta_version
cp $target_dist_dir/deb/opt/$package_binary_name/* \
$target_dist_dir/$package_binary_name-$meta_version
log "Building .tar.bz2 file"
tar_extra=""
if [ $host_os == "mac" ]; then
tar_extra="--no-xattrs --no-mac-metadata"
fi
(cd $target_dist_dir && tar -cvjS $tar_extra -f $out_bz2_file $package_binary_name-$meta_version)
rm -rf $target_dist_dir/$package_binary_name-$meta_version
rm -rf $target_dist_dir/deb
fi
# ===============================================
# Mac
# ===============================================
if [[ $node_os == "mac" ]]; then
if ! [ -x "$(command -v create-dmg)" ]; then
error "create-dmg not installed"
fi
dot_app_dir=$target_dist_dir/dotApp/
app_dir=$dot_app_dir/$meta_id.app
macos_dir=$app_dir/Contents/MacOS
res_dir=$app_dir/Contents/Resources
scripts_dir=$target_dist_dir/scripts
mkdir -p $macos_dir
mkdir -p $res_dir
mkdir -p $scripts_dir
cp LICENSE.txt README.md assets/mac/icon.icns $res_dir
cp $target_dist_dir/ffmpeg \
$target_dist_dir/ffprobe \
$target_dist_dir/filepicker \
$target_dist_dir/$package_binary_name \
$macos_dir
# Note: without the shebang, the app is considered damaged by MacOS.
echo '#!/bin/bash' > $macos_dir/register.sh
echo 'cd $(dirname $0)/ && ./vdhcoapp install' >> $macos_dir/register.sh
chmod +x $macos_dir/register.sh
echo '#!/bin/bash' > $scripts_dir/postinstall
echo "su \"\$USER\" -c \$DSTROOT/$meta_id.app/Contents/MacOS/register.sh" >> $scripts_dir/postinstall
chmod +x $scripts_dir/postinstall
ejs -f $target_dist_dir/config.json ./assets/mac/pkg-distribution.xml.ejs > $target_dist_dir/pkg-distribution.xml
ejs -f $target_dist_dir/config.json ./assets/mac/pkg-component.plist.ejs > $target_dist_dir/pkg-component.plist
ejs -f $target_dist_dir/config.json ./assets/mac/Info.plist.ejs > $app_dir/Contents/Info.plist
pkgbuild_sign=()
create_dmg_sign=()
create_dmg_notarize=()
if [ ! $skip_signing == 1 ]; then
log "Signing binaries"
# IMPORTANT: the entry point CFBundleExecutable must be the last
# object to be signed! (register.sh here)
codesign --entitlements \
./assets/mac/entitlements.plist \
--options=runtime --timestamp -v -f \
-s "$package_mac_signing_app_cert" \
$macos_dir/ffmpeg \
$macos_dir/filepicker \
$macos_dir/ffprobe \
$macos_dir/vdhcoapp \
$macos_dir/register.sh
pkgbuild_sign=("--sign" "$package_mac_signing_pkg_cert")
create_dmg_sign=("--codesign" "$package_mac_signing_app_cert")
else
log "Skip signing"
fi
if [ ! $skip_notary == 1 ]; then
create_dmg_notarize=("--notarize" "$package_mac_signing_keychain_profile")
fi
log "Creating .pkg file"
pkgbuild \
--root $dot_app_dir \
--install-location /Applications \
--scripts $scripts_dir \
--identifier $meta_id \
--component-plist $target_dist_dir/pkg-component.plist \
--version $meta_version \
${pkgbuild_sign[@]+"${pkgbuild_sign[@]}"} \
$target_dist_dir/$out_pkg_file
log "Creating .dmg file"
create-dmg \
--volname "$meta_long_name" \
--background ./assets/mac/dmg-background.tiff \
--window-pos 200 120 --window-size 500 400 --icon-size 70 \
--hide-extension "$meta_id.app" \
--icon "$meta_id.app" 100 200 \
--app-drop-link 350 200 \
${create_dmg_sign[@]+"${create_dmg_sign[@]}"} \
${create_dmg_notarize[@]+"${create_dmg_notarize[@]}"} \
$target_dist_dir/$out_dmg_file \
$dot_app_dir
rm $target_dist_dir/pkg-distribution.xml
rm $target_dist_dir/pkg-component.plist
rm $scripts_dir/postinstall
rm -rf $scripts_dir
if [ ! $skip_notary == 1 ] && [ ! $skip_signing == 1 ]; then
log "Sending .pkg to Apple for signing"
log "In case of issues, run \"xcrun notarytool log UUID --keychain-profile $package_mac_signing_keychain_profile\""
xcrun notarytool submit $target_dist_dir/$out_pkg_file --keychain-profile $package_mac_signing_keychain_profile --wait
xcrun stapler staple $target_dist_dir/$out_pkg_file
fi
fi
# ===============================================
# Windows
# ===============================================
if [ $node_os == "windows" ]; then
install_dir=$target_dist_dir/install_dir
mkdir -p $install_dir
IFS=',' read -a stores <<< "$(yq '.store | keys' ./config.toml -o csv)"
for store in "${stores[@]}"
do
yq ".store.$store.manifest" ./config.toml -o yaml | \
yq e ".name = \"$meta_id\"" |\
yq e ".description = \"$meta_description\"" |\
yq e ".path = \"$package_binary_name.exe\"" -o json > $install_dir/$store.json
done
cp $target_dist_dir/$package_binary_name.exe \
$target_dist_dir/filepicker.exe \
$target_dist_dir/ffmpeg.exe \
$target_dist_dir/ffprobe.exe \
$install_dir
cp LICENSE.txt $target_dist_dir
cp assets/windows/icon.ico $target_dist_dir
ejs -f $target_dist_dir/config.json ./assets/windows/installer.nsh.ejs > $target_dist_dir/installer.nsh
log "Building Windows installer"
(cd $target_dist_dir ; makensis -V4 ./installer.nsh)
rm -r $install_dir $target_dist_dir/installer.nsh $target_dist_dir/LICENSE.txt $target_dist_dir/icon.ico
if [ ! $skip_signing == 1 ]; then
log "Signing Windows installer"
osslsigncode sign -pkcs12 $package_windows_certificate \
-in $target_dist_dir/installer.exe \
-out $target_dist_dir/$out_win_file
rm $target_dist_dir/installer.exe
else
mv $target_dist_dir/installer.exe $target_dist_dir/$out_win_file
fi
fi
fi
rm $target_dist_dir/config.json
target_dist_dir=$dist_dir/$target_os/$target_arch
if [ $node_os == "windows" ]; then
log "Binary available: $target_dist_dir_rel/$package_binary_name.exe"
log "Binary available: $target_dist_dir_rel/filepicker.exe"
log "Binary available: $target_dist_dir_rel/ffmpeg.exe"
log "Binary available: $target_dist_dir_rel/ffprobe.exe"
if [ ! $skip_packaging == 1 ]; then
log "Installer available: $target_dist_dir_rel/$out_win_file"
fi
fi
if [ $target_os == "linux" ]; then
log "Binary available: $target_dist_dir_rel/$package_binary_name"
log "Binary available: $target_dist_dir_rel/filepicker"
log "Binary available: $target_dist_dir_rel/ffmpeg"
log "Binary available: $target_dist_dir_rel/ffprobe"
if [ ! $skip_packaging == 1 ]; then
log "Deb file available: $target_dist_dir_rel/$out_deb_file"
log "Deb file available: $target_dist_dir_rel/$out_noffmpeg_deb_file"
log "Tarball available: $target_dist_dir_rel/$out_bz2_file"
log "Tarball available: $target_dist_dir_rel/$out_noffmpeg_bz2_file"
fi
fi
if [ $target_os == "mac" ]; then
log "Binary available: $target_dist_dir_rel/$package_binary_name"
log "Binary available: $target_dist_dir_rel/filepicker"
log "Binary available: $target_dist_dir_rel/ffmpeg"
log "Binary available: $target_dist_dir_rel/ffprobe"
if [ ! $skip_packaging == 1 ]; then
log "App available: $target_dist_dir_rel/dotApp/$meta_id.app"
log "Pkg available: $target_dist_dir_rel/$out_pkg_file"
log "Dmg available: $target_dist_dir_rel/$out_dmg_file"
fi
fi