browser-extension/deploy.sh

55 lines
961 B
Bash
Raw Permalink Normal View History

2022-04-07 13:45:05 +00:00
#!/bin/bash
# build package
set -e
if [[ $(basename "$(pwd)") != 'tubearchivist_browserextension' ]]; then
echo 'not in tubearchivist_browserextension folder'
exit 1
fi
2023-01-14 02:29:29 +00:00
echo "latest tags:"
git tag | tail -n 5 | sort -r
2022-04-07 13:45:05 +00:00
printf "\ncreate new version:\n"
read -r VERSION
# build release zip files
function create_zip {
cd extension
# firefox
rm manifest.json
cp manifest-firefox.json manifest.json
zip -rq ../release/ta-companion-"$VERSION"-firefox.zip . \
-x manifest-chrome.json -x manifest-firefox.json
# chrome
rm manifest.json
cp manifest-chrome.json manifest.json
zip -rq ../release/ta-companion-"$VERSION"-chrome.zip . \
-x manifest-chrome.json -x manifest-firefox.json
rm manifest.json
cd ..
}
# create release tag
function create_release {
git tag -a "$VERSION" -m "new release version $VERSION"
2022-06-04 02:40:10 +00:00
git push origin "$VERSION"
2022-04-07 13:45:05 +00:00
}
create_zip
create_release
##
exit 0