-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·37 lines (27 loc) · 951 Bytes
/
release.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
#!/bin/bash -e
version=$(git describe --tags --dirty)
name=$(echo fibonacci-led-$version.zip)
echo "Building release $version"
cp metadata.json.template metadata.json
sed -i -e "s/VERSION/$version/g" metadata.json
sed -i '/download_/d' metadata.json
sed -i '/install_size/d' metadata.json
mkdir resources
cp icon/icon_64x64.png resources/
mv resources/icon_64x64.png resources/icon.png
mkdir plugins
cp __init__.py plugins/
cp icon.png plugins/
cp -r onekiwi/ plugins/
zip -r $name plugins resources metadata.json
rm -rf plugins
rm -rf resources
sha=$(sha256sum $name | cut -d' ' -f1)
size=$(du -b $name | cut -f1)
installSize=$(unzip -l $name | tail -1 | xargs | cut -d' ' -f1)
cp metadata.json.template metadata.json
sed -i -e "s/VERSION/$version/g" metadata.json
sed -i -e "s/SHA256/$sha/g" metadata.json
sed -i -e "s/DOWNLOAD_SIZE/$size/g" metadata.json
sed -i -e "s/INSTALL_SIZE/$installSize/g" metadata.json
ls -lh $name metadata.json