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 94840db commit 667150a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Kuper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

object Kuper {
const val appId = "dev.jahir.kuper.app"
const val version = 225
const val versionName = "2.2.5"
const val version = 226
const val versionName = "2.2.6"
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object Versions {
const val buildTools = "30.0.0"

// Frames
const val frames = "3.3.5"
const val frames = "3.3.6"

// Kustom API
const val kustomApi = "6369c37"
Expand Down
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 667150a

Please sign in to comment.