forked from getAlby/lightning-browser-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-packages.sh
executable file
·74 lines (55 loc) · 1.66 KB
/
create-packages.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
#!/bin/bash
# Extract version from package.json
VERSION=$(node -pe "require('./package.json').version")
NODE_ENV=production
if [ -z ${ALBY_OAUTH_CLIENT_ID_CHROME+x} ];
then
echo "OAuth client id for Chrome:"
read ALBY_OAUTH_CLIENT_ID_CHROME
fi
if [ -z ${ALBY_OAUTH_CLIENT_SECRET_CHROME+x} ];
then
echo "OAuth client secret for Chrome:"
read ALBY_OAUTH_CLIENT_SECRET_CHROME
fi
if [ -z ${ALBY_OAUTH_CLIENT_ID_FIREFOX+x} ];
then
echo "OAuth client id for Firefox:"
read ALBY_OAUTH_CLIENT_ID_FIREFOX
fi
if [ -z ${ALBY_OAUTH_CLIENT_SECRET_FIREFOX+x} ];
then
echo "OAuth client secret for Firefox:"
read ALBY_OAUTH_CLIENT_SECRET_FIREFOX
fi
if [ -z ${ALBY_API_URL+x} ];
then
ALBY_API_URL="https://api.getalby.com"
fi
echo "Creating the build for v$VERSION"
yarn build
echo "Creating zip packages for v$VERSION"
cd dist/production
cd firefox
# Normalize timestamp to get reproducible zip file
find . -exec touch -t 200810310000 {} +
# Create zip file
zip -rX ../alby-firefox-v$VERSION.xpi *
SHA=$(sha512sum -b ../alby-firefox-v$VERSION.xpi)
echo "Created alby-firefox-v$VERSION.xpi (SHA512: $SHA)"
cd ../chrome
# Normalize timestamp to get reproducible zip file
find . -exec touch -t 200810310000 {} +
# Create zip file
zip -rX ../alby-chrome-v$VERSION.zip *
SHA=$(sha512sum -b ../alby-chrome-v$VERSION.zip)
echo "Created alby-chrome-v$VERSION.zip (SHA512: $SHA)"
cd ../opera
# Normalize timestamp to get reproducible zip file
find . -exec touch -t 200810310000 {} +
# Create zip file
zip -rX ../alby-opera-v$VERSION.crx *
SHA=$(sha512sum -b ../alby-opera-v$VERSION.crx)
echo "Created alby-opera-v$VERSION.crx (SHA512: $SHA)"
echo "done!"
cd ../../../