Last active
December 27, 2024 04:40
-
-
Save raipradeep/aed91c02bcefeeaa2eb7926013cc89db to your computer and use it in GitHub Desktop.
CI/CD For Android App With Telegram
This file contains 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
name: Build APK and Send to Telegram | |
on: | |
push: | |
branches: | |
- feature/telegramCICD | |
jobs: | |
build-and-send: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Set up Android SDK | |
uses: android-actions/setup-android@v2 | |
with: | |
api-level: 30 | |
build-tools: 30.0.3 | |
- name: Build with Gradle | |
run: | | |
chmod +x ./gradlew | |
./gradlew assembleSitRelease | |
- name: Send APK to Telegram | |
env: | |
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_ID }} | |
run: | | |
APK_PATH="$Path/app_Name_.apk" | |
echo "Sending APK: $APK_PATH" | |
curl -F chat_id=$TELEGRAM_ID \ | |
-F document=@"app/build/outputs/apk/Sit/release/app-Sit-release.apk" \ | |
-F caption="Here is the latest APK build for the Sit release." \ | |
"https://api.telegram.org/botTELEGRAM_TOKEN/sendDocument" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment