-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sh
executable file
·65 lines (56 loc) · 2.21 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
version=$1
generate_update_json() {
new_version=$1
browser_type=$2
update_file_name="updates.json"
addon_id="e34d5840-6b3b-49d8-92c2-9696798c4e2a"
build_fragment="fx"
if [ "$browser_type" == "android" ]; then
update_file_name="updates_android.json"
addon_id="aaaa5840-6b3b-49d8-92c2-9696798c4e2a"
build_fragment="an"
fi
sed -i "/$new_version/d" versions.txt
echo "{
\"addons\": {
\"{$addon_id}\": {
\"updates\": [" > "$update_file_name"
while IFS= read -r old_version; do
echo " {
\"version\": \"$old_version\",
\"update_link\": \"https://github.com/andreicristianpetcu/google_translate_this/releases/download/v$old_version/google_translate_this_page-$old_version-$build_fragment.xpi\"
}," >>"$update_file_name"
done <versions.txt
printf "$new_version\n" >>versions.txt
echo " {
\"version\": \"$new_version\",
\"update_link\": \"https://github.com/andreicristianpetcu/google_translate_this/releases/download/v$new_version/google_translate_this_page-$new_version-$build_fragment.xpi\"
}
]
}
}
}" >>"$update_file_name"
}
sed -i -E "s/\"version\":(.*)/\"version\": \"$version\",/" manifest_desktop.json
sed -i -E "s/\"version\":(.*)/\"version\": \"$version\",/" manifest_android.json
cat rm_template.md > README.md
sed -i -E "s/NEW_VERSION/$version/" README.md
sed -i -E "s/NEW_VERSION/$version/" README.md
generate_update_json "$version" "android"
generate_update_json "$version" "desktop"
#build desktop
cat manifest_desktop.json > manifest.json
web-ext lint -s . --self-hosted -i "*.sh"
zip tr_desktop.zip manifest.json scripts/* images/* _locales/**/* options/*
rm -rf manifest.json
#build android
cat manifest_android.json > manifest.json
web-ext lint -s . --self-hosted -i "*.sh"
zip tr_android.zip manifest.json scripts/* images/* _locales/**/* options/*
rm -rf manifest.json
# git add .
# git commit -m "Release v$version"
# git tag "v$version"
xdg-open https://addons.mozilla.org/en-US/developers/addon/60f12ab296874cd39fef/versions
xdg-open https://addons.mozilla.org/en-US/developers/addon/google-translate-this-page1/versions
xdg-open https://github.com/andreicristianpetcu/google_translate_this/releases