-
-
Notifications
You must be signed in to change notification settings - Fork 30
54 lines (46 loc) · 1.84 KB
/
Copy pathdebug.yml
File metadata and controls
54 lines (46 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build Debug APK
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get the source
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Generate Debug APKs
run: ./gradlew assembleFullDebug assembleFossDebug
- name: Install curl
run: sudo apt-get update && sudo apt-get install -y curl
- name: Upload Debug APKs to Telegram
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: |
FULL_DEBUG_APK="app/build/outputs/apk/full/debug/app-full-debug.apk"
FOSS_DEBUG_APK="app/build/outputs/apk/foss/debug/app-foss-debug.apk"
if [ -f "$FULL_DEBUG_APK" ]; then
echo "Uploading Full Debug APK..."
curl -s -X POST "https://api.telegram.org/bot${{ env.TELEGRAM_BOT_TOKEN }}/sendDocument" \
-F chat_id=${{ env.TELEGRAM_CHAT_ID }} \
-F caption="Full Debug APK Build #${{ github.run_number }}" \
-F document=@"$FULL_DEBUG_APK"
else
echo "Error: Full Debug APK not found at $FULL_DEBUG_APK."
fi
if [ -f "$FOSS_DEBUG_APK" ]; then
echo "Uploading Foss Debug APK..."
curl -s -X POST "https://api.telegram.org/bot${{ env.TELEGRAM_BOT_TOKEN }}/sendDocument" \
-F chat_id=${{ env.TELEGRAM_CHAT_ID }} \
-F caption="Foss Debug APK Build #${{ github.run_number }}" \
-F document=@"$FOSS_DEBUG_APK"
else
echo "Error: Foss Debug APK not found at $FOSS_DEBUG_APK."
fi