-
Notifications
You must be signed in to change notification settings - Fork 68
105 lines (87 loc) · 2.95 KB
/
Copy pathandroid.yml
File metadata and controls
105 lines (87 loc) · 2.95 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Continuous integration
on:
push:
branches: [ develop ]
paths-ignore:
- '**/*.md'
- '.claude/**'
- 'LICENSE'
- '.editorconfig'
- '.gitignore'
pull_request:
branches: [ develop ]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Fetch Firebase google-services.json
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
run: |
rm -f app/google-services.json
npx firebase-tools@latest apps:sdkconfig ANDROID "$FIREBASE_APP_ID" \
--project "$FIREBASE_PROJECT_ID" \
-o app/google-services.json
- name: Spotless check
run: ./gradlew spotlessCheck
- name: Lint check
run: ./gradlew lintDebug
- name: Build debug APK
run: |
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
VERSION_NAME="pr${{ github.event.pull_request.number }}.$GITHUB_RUN_NUMBER"
else
VERSION_NAME="dev.$GITHUB_RUN_NUMBER"
fi
./gradlew assembleDebug -Pversion.name=$VERSION_NAME
- name: Rename APK
run: mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/apk-analyzer.apk
- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: apk-analyzer
path: app/build/outputs/apk/debug/apk-analyzer.apk
retention-days: 14
distribute:
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Download APK artifact
uses: actions/download-artifact@v4
with:
name: apk-analyzer
path: artifacts
- name: Write Firebase release notes
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
cat > release-notes.txt <<NOTES
$COMMIT_MESSAGE
Commit: ${{ github.sha }}
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
NOTES
- name: Distribute APK to Firebase App Distribution
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
run: |
npx firebase-tools@latest appdistribution:distribute artifacts/apk-analyzer.apk \
--app "$FIREBASE_APP_ID" \
--groups "internal-testers" \
--release-notes-file release-notes.txt