Skip to content

Commit efde3ae

Browse files
authored
Update android.yml
1 parent 92ff74e commit efde3ae

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/android.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Android CI
33
on:
44
push:
55
branches: [ "deploy" ]
6+
workflow_dispatch:
67
jobs:
78
build:
89

@@ -23,3 +24,50 @@ jobs:
2324
run: chmod +x gradlew
2425
- name: Build with Gradle
2526
run: ./gradlew build
27+
28+
---------
29+
30+
name: Android Release Build
31+
32+
on:
33+
push:
34+
branches:
35+
- deploy
36+
37+
jobs:
38+
build:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
# Checkout the repository
43+
- name: Checkout Code
44+
uses: actions/checkout@v4
45+
46+
# Set up JDK 11
47+
- name: Set up JDK 11
48+
uses: actions/setup-java@v4
49+
with:
50+
java-version: '11'
51+
distribution: 'temurin'
52+
cache: gradle
53+
54+
# Create local.properties file dynamically
55+
- name: Create local.properties
56+
run: |
57+
echo "google-web-client-id=${{ secrets.GOOGLE_WEB_CLIENT_ID }}" > local.properties
58+
echo "sdk.dir=${{ env.ANDROID_SDK_ROOT }}" >> local.properties
59+
60+
# Grant execute permission for gradlew
61+
- name: Grant execute permission for gradlew
62+
run: chmod +x gradlew
63+
64+
# Build the APK with Gradle (Release build)
65+
- name: Build APK (Release)
66+
run: ./gradlew assembleRelease
67+
68+
# Upload the APK as an artifact (optional)
69+
- name: Upload APK artifact
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: app-release-apk
73+
path: app/build/outputs/apk/release/app-release-by-action.apk

0 commit comments

Comments
 (0)