Created
October 14, 2022 12:59
-
-
Save hram/f29259bd5f43016a4cd47577b11f7783 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deployAlpha: | |
extends: .deploy_base | |
variables: | |
TELEGRAM_MESSAGE: "Новая *alpha* сборка доступна по ссылке%3A%0A" | |
script: | |
- | | |
chmod +x ./createReleaseNotes.sh | |
./createReleaseNotes.sh | |
RELEASE_NOTES=$(find . -type f -name "release_notes.txt" -exec cat {} \; | awk 'BEGIN {RS=""}{gsub(/\n/,"%0A",$0); print $0}') | |
- base64 -d $KEYSTORE_FILE > keystore.jks | |
- ./gradlew :app:assembleAlphaRelease | |
- | | |
file_to_upload=$(find ./app/build/ -name "*.apk" | tail -n1) | |
filename="$(basename -- $file_to_upload)" | |
echo "Отправляем файл ${filename} в Nexus" | |
curl -sSfL -H "Authorization: Basic ${NEXUS_AUTH}" --upload-file ${file_to_upload} "${NEXUS_PROJECT_URL}/${filename}" | |
- echo "Сборку можно скачать по ссылке ${NEXUS_PROJECT_URL}/${filename}" | |
- | | |
echo "Отправляем сообщение в телегу" | |
curl -sSfL -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" -d "chat_id=${TELEGRAM_CHAT_ID}&parse_mode=Markdown&text=${TELEGRAM_MESSAGE}${NEXUS_PROJECT_URL}/${filename}%0A%0ARelease notes%3A%0A%60%60%60%0A${RELEASE_NOTES:=WereNotProvided}%0A%60%60%60" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment