Skip to content

Commit

Permalink
Add Telegram notifications steps
Browse files Browse the repository at this point in the history
  • Loading branch information
evgfilim1 committed Apr 6, 2024
1 parent 133b6e2 commit 6281c0e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ jobs:
build/app/outputs/flutter-apk/app-*.apk
build/app/outputs/flutter-apk/app-*.apk.sha1
- name: Send dev APK to testers Telegram group
if: !startsWith(github.ref, 'refs/tags/v')
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: |
actual_version="$(git describe --tags --always | sed -E 's/(-([0-9]+)-g([0-9a-f]+))?$/.r\2-\3/g')"
curl --silent --show-error --fail-with-body \
-F "chat_id=${TELEGRAM_CHAT_ID}" \
-F "document=@build/app/outputs/flutter-apk/app-arm64-v8a-dev-release.apk" \
-F "caption=New version: ${actual_version}" \
"https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument" \
>/dev/null
continue-on-error: true

build-web:
name: Build app for web
runs-on: ubuntu-latest
Expand Down Expand Up @@ -218,3 +233,17 @@ jobs:
files: |
build/app-*.apk
fail_on_unmatched_files: true

- name: Send release info to testers Telegram group
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: |
release_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${GITHUB_REF_NAME}"
curl --silent --show-error --fail-with-body \
-F "chat_id=${TELEGRAM_CHAT_ID}" \
-F "parse_mode=MarkdownV2" \
-F "text=New release: [${GITHUB_REF_NAME}](${release_url})" \
"https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
>/dev/null
continue-on-error: true

0 comments on commit 6281c0e

Please sign in to comment.