tridactyl/scripts/sign

68 lines
2.1 KiB
Text
Raw Normal View History

2017-11-09 13:10:43 +00:00
#!/usr/bin/env bash
2017-11-12 01:53:04 +00:00
set -e
2017-11-09 13:10:43 +00:00
sign_and_submit() {
2017-11-13 16:25:34 +00:00
# Don't trust the return value of web-ext sign.
2021-04-30 10:47:11 +02:00
(source AMOKEYS && (yarn run web-ext sign -s build --api-key "$AMOKEY" --api-secret "$AMOSECRET" "$@" || true))
2017-11-09 13:10:43 +00:00
}
2019-05-06 15:46:50 +02:00
publish_beta_nonewtab() {
2019-05-31 16:48:53 +01:00
yarn run clean
yarn run build --no-native
2019-05-06 15:46:50 +02:00
scripts/version.js beta
sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim.betas.nonewtab@cmcaine/' -i build/manifest.json
2019-05-09 22:31:47 +02:00
sed '/\s*"newtab":.*/d' -i build/manifest.json
2019-05-22 11:41:53 +01:00
sed 's/"name": "Tridactyl"/"name": "Tridactyl: No New Tab"/' -i build/manifest.json
2019-05-11 01:52:06 +02:00
sign_and_submit -a web-ext-artifacts/nonewtab
2019-05-06 15:46:50 +02:00
}
2017-11-09 13:10:43 +00:00
publish_beta() {
2019-05-31 16:48:53 +01:00
yarn run clean
yarn run build --no-native
2017-11-12 01:53:04 +00:00
scripts/version.js beta
2019-05-22 11:41:53 +01:00
sed 's/"name": "Tridactyl"/"name": "Tridactyl: Beta"/' -i build/manifest.json
2017-11-09 13:10:43 +00:00
sign_and_submit
2021-04-30 10:47:11 +02:00
tar --exclude-from=<(.grep -v .build_cache/ .gitignore) --exclude-vcs -czf ../../public_html/betas/tridactyl_source_beta.tar.gz .
2017-11-09 13:10:43 +00:00
}
build_no_sign_beta(){
yarn run clean
yarn run build --no-native
scripts/version.js beta
sed 's/"name": "Tridactyl"/"name": "Tridactyl: Beta"/' -i build/manifest.json
mkdir -p web-ext-artifacts
2021-04-30 10:47:11 +02:00
yarn run web-ext build --source-dir ./build --overwrite-dest
for f in web-ext-artifacts/*.zip; do
2021-04-30 10:47:11 +02:00
mv "$f" "${f%.zip}".xpi
done
}
build_no_sign_stable(){
yarn run clean
yarn run build --no-native
sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim@cmcaine/' -i build/manifest.json
mkdir -p web-ext-artifacts
2021-04-30 10:47:11 +02:00
yarn run web-ext build --source-dir ./build --overwrite-dest
for f in web-ext-artifacts/*.zip; do
2021-04-30 10:47:11 +02:00
mv "$f" "${f%.zip}".xpi
done
}
2017-11-12 01:12:57 +00:00
publish_stable() {
2019-05-31 16:48:53 +01:00
yarn run clean
yarn run build --no-native
sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim@cmcaine/' -i build/manifest.json
2017-11-12 01:12:57 +00:00
sign_and_submit
2021-04-30 10:47:11 +02:00
tar --exclude-from=<(grep -v .build_cache/ .gitignore) --exclude-vcs -czf ../../public_html/betas/tridactyl_source.tar.gz .
2017-11-12 01:12:57 +00:00
}
case $1 in
stable) publish_stable;;
2019-09-23 06:24:55 +01:00
nosignstable) build_no_sign_stable;;
nosignbeta) build_no_sign_beta;;
2019-05-06 15:46:50 +02:00
nonewtab) publish_beta_nonewtab;;
2021-04-30 10:47:11 +02:00
beta) publish_beta;;
*) publish_beta;;
2017-11-12 01:12:57 +00:00
esac