-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 2.18 KB
/
android.yml
File metadata and controls
79 lines (67 loc) · 2.18 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Android CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Android Keystore
run: |
echo "${{ secrets.CI_KEYSTORE_BASE64 }}" | base64 -d > ${{ runner.temp }}/release.keystore
echo "CI_KEYSTORE_PATH=${{ runner.temp }}/release.keystore" >> $GITHUB_ENV
- name: Build APKs
run: ./gradlew assembleDebug
- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: debug-apk
path: app/build/outputs/apk/debug/*.apk
retention-days: 7
# - name: Upload Release APK
# uses: actions/upload-artifact@v4
# with:
# name: release-apk
# path: app/build/outputs/apk/release/*.apk
# retention-days: 7
# Telegram 通知
- name: Send Telegram Notification
uses: appleboy/telegram-action@master
if: always()
with:
to: ${{ env.TELEGRAM_CHAT_ID }}
token: ${{ env.TELEGRAM_BOT_TOKEN }}
message: |
📲 Android CI 构建结果
──────────────────
▫️ 仓库: ${{ github.repository }}
▫️ 分支: ${{ github.ref_name }}
▫️ 提交: ${{ github.sha }}
▫️ 状态: ${{ job.status }}
▫️ 工作流: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
document: |
app/build/outputs/apk/debug/*.apk
format: HTML