-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
78 lines (55 loc) · 1.42 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
#!/usr/bin/env bash
# Create version string.
DATE=`date +%s`
CERT='selfDB.p12'
KEY='Alias2Mocha7'
ORG="Atomic Lotus, LLC"
COUNTRY="US"
CITY="Richmond"
DOMAIN="atomiclotus.net"
VERS=`cat VERSION`
NAME=${PWD##*/}
BUNDLE_ID="com.atomic.$NAME"
# Execute Gulp build to concat assets.
# gulp build
# Wait for gulp build to complete.
# wait $!
# If the `build` directory exists, delete it.
if [ -d build ]; then
rm -Rf build
fi
# If the `dist` directory exists, clear its contents.
if [ -d dist ]; then
rm -Rf dist/*
fi
# If the `dist` directory does not exist, create it.
if [ ! -d dist ]; then
mkdir dist
fi
# Create a clean build directory.
mkdir build
# Copy source code to build directory.
cp -R client build/client
cp -R csxs build/csxs
cp -R host build/host
cp -R custom build/custom
if [ -f icon.png ]; then
cp icon.png build/icon.png
fi
# Build and sign the extension.
./bin/ZXPSignCmd -selfSignedCert $COUNTRY $CITY "$ORG" $DOMAIN $KEY ./bin/$CERT
./bin/ZXPSignCmd -sign build dist/$NAME-$VERS.zxp ./bin/$CERT $KEY -tsa https://www.safestamper.com/tsa
# Build custom installers
#cep-packager \
# --name $NAME \
# --bundle-id $BUNDLE_ID \
# --version $VERS \
# --macos-resources $PWD/resources/macos \
# --windows-resources $PWD/resources/windows \
# --macos-dest $PWD/dist/$NAME.$VERS.pkg \
# --windows-dest $PWD/dist/$NAME.$VERS.exe \
# ./build
# Delete the build directory.
if [ -d build ]; then
rm -Rf build
fi