-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.96 KB
/
android.yml
File metadata and controls
60 lines (51 loc) · 1.96 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
name: Android CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# ✅ Checkout Code
- name: Checkout code
uses: actions/checkout@v3
# ✅ Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
# ✅ Make Gradle Executable
- name: Make Gradle executable
run: chmod +x ./gradlew
# ✅ Decode Keystore and Set Signing Env Vars
# ✅ Decode Keystore and Export All Required Variables
# Download Keystore securely using Base64 (assuming you uploaded it as a GitHub Secret)
# To Get Base64 path File Run Your Jks File In powerShell
# My Path ([Convert]::ToBase64String([IO.File]::ReadAllBytes("C:\Users\balachandra.d\private\NotesFirebase\.gradle\notefirebase.jks")) > C:\Users\balachandra.d\private\NotesFirebase\.gradle\notefirebase.b64)
- name: Decode Keystore and Set Signing Env Vars
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > notefirebase.jks
echo "KEYSTORE_FILE=notefirebase.jks" >> $GITHUB_ENV
echo "KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> $GITHUB_ENV
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> $GITHUB_ENV
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> $GITHUB_ENV
# ✅ Build APKs
- name: Build Debug and Release APKs
run: |
./gradlew assembleDebug
./gradlew assembleRelease
# ✅ Upload Debug APK
- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: app-debug.apk
path: app/build/outputs/apk/debug/app-debug.apk
# ✅ Upload Release APK
- name: Upload Release APK
uses: actions/upload-artifact@v4
with:
name: app-release.apk
path: app/build/outputs/apk/release/app-release.apk