Skip to content

Commit

Permalink
Update publish apk script
Browse files Browse the repository at this point in the history
  • Loading branch information
jahirfiquitiva committed Nov 22, 2020
1 parent c2976e6 commit a36d949
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Frames.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

object Frames {
const val appId = "dev.jahir.frames.app"
const val version = 335
const val versionName = "3.3.5"
const val version = 336
const val versionName = "3.3.6"
}
26 changes: 8 additions & 18 deletions publish_apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,18 @@ if [ "$TRAVIS_PULL_REQUEST" = false ]; then

if [[ ! -z "$url" && "$url" != " " && "$url" != "null" ]]; then
printf "\nAPK url: $url"
message=$"*New ${repoName} update available! (${releaseName})* 🚀${ln}${ln}*Changes:*${ln}${changes}"
btns=$"{\"inline_keyboard\":[[{\"text\":\"How to update\",\"url\":\"https://github.com/${TRAVIS_REPO_SLUG}/wiki/How-to-update\"}],[{\"text\":\"Download sample APK\",\"url\":\"${url}\"}],[{\"text\":\"Donate\",\"url\":\"https://jahir.dev/donate\"}]]}"

printf "\n\nSending message to Telegram channel…\n"
telegramUrl="https://api.telegram.org/bot${TEL_BOT_KEY}/sendMessage?chat_id=@JFsDashSupport&text=${message}&parse_mode=Markdown&reply_markup=${btns}"
echo "Telegram url: ${telegramUrl}"
printf "\n\n"
curl -g "${telegramUrl}"

printf "\n\nSending message to Discord channel…\n"
messageBody="**Changes:**\n$defaultChanges"
messageBody+="\n\n**Useful links:**"
messageBody+="\n* [How to update?](https://github.com/jahirfiquitiva/$repoName/wiki/How-to-update)"
messageBody+="\n* [Download sample APK]("
messageBody+="$url"
messageBody+=")\n* [Donate & support future development](https://jahir.dev/donate)"
echo $messageBody
curl -X POST -H 'Content-Type: application/json' -d '{ "embeds": [{ "title": "**New update available! ('"$releaseName"')** 🚀", "description": "'"$messageBody"'", "color": 15844367 }] }' $UPDATE_DISCORD_WEBHOOK
message="**Changes:**\n$defaultChanges"
message+="\n\n**Useful links:**"
message+="\n* [How to update?](https://github.com/jahirfiquitiva/$repoName/wiki/How-to-update)"
message+="\n* [Download sample APK]("
message+="$url"
message+=")\n* [Donate & support future development](https://jahir.dev/donate)"
curl -X POST -H 'Content-Type: application/json' -d '{ "embeds": [{ "title": "**New update available! ('"$releaseName"')** 🚀", "description": "'"$message"'", "color": 15844367 }] }' $UPDATE_DISCORD_WEBHOOK

printf "\n\nFinished uploading APK(s) and sending notifications\n"
else
printf "\n\nSkipping Telegram report because no file was uploaded\n"
printf "\n\nSkipping notifications because no file was uploaded\n"
fi
done
else
Expand Down

0 comments on commit a36d949

Please sign in to comment.