forked from Vocab-Apps/anki-hyper-tts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·30 lines (24 loc) · 950 Bytes
/
package.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
#!/bin/sh
VERSION_NUMBER=$1 # for example 0.1
GIT_TAG=v${VERSION_NUMBER}
# build web assets
./build_web_assets.sh || { echo 'build_web_assets.sh' ; exit 1; }
echo "ANKI_HYPER_TTS_VERSION='${VERSION_NUMBER}'" > version.py
git commit -a -m "upgraded version to ${VERSION_NUMBER}"
git push
git tag -a ${GIT_TAG} -m "version ${GIT_TAG}"
git push origin ${GIT_TAG}
# create .addon file
# remove meta.json, which contains private key
rm meta.json
rm -rf __pycache__
rm user_files/*.mp3
rm user_files/*.ogg
rm -rvf htmlcov/
ADDON_FILENAME=${HOME}/anki-addons-releases/anki-hyper-tts-${VERSION_NUMBER}.ankiaddon
zip --exclude "*node_modules*" "*__pycache__*" "test_*.py" "*test_services*" "*.ini" "*.workspace" "*.md" "*.sh" requirements.txt "*.code-workspace" "web" -r ${ADDON_FILENAME} *
# sync
rclone sync ~/anki-addons-releases/ dropbox:Anki/anki-addons-releases/
# if you need to undo a release:
# git tag -d v0.2
# git push --delete origin v0.2