Nagram/bin/upload_alaha.sh

34 lines
618 B
Bash
Raw Normal View History

2020-08-01 02:33:54 +00:00
#!/bin/bash
2020-10-04 10:14:58 +00:00
./gradlew TMessagesProj:assembleFullRelease \
TMessagesProj:assembleFullReleaseNoGcm
trap 'kill $(jobs -p)' SIGINT
2020-08-01 02:33:54 +00:00
2020-10-04 10:14:58 +00:00
function upload() {
for apk in $outPath/*.apk; do
2020-08-01 02:33:54 +00:00
echo ">> Uploading $apk"
curl https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument \
2020-10-04 10:14:58 +00:00
-X POST \
-F chat_id="$TELEGRAM_CHANNEL" \
-F document="@$apk" \
--silent --show-error --fail >/dev/null &
2020-08-01 02:33:54 +00:00
2020-10-04 10:14:58 +00:00
done
2020-08-01 02:33:54 +00:00
2020-10-04 10:14:58 +00:00
for job in $(jobs -p); do
wait $job
done
}
outPath="TMessagesProj/build/outputs/apk/full/release"
upload
outPath="TMessagesProj/build/outputs/apk/full/releaseNoGcm"
2020-08-01 02:33:54 +00:00
2020-10-04 10:14:58 +00:00
upload