Enhance Android build process and add settings for update management

- Implement caching for Android debug keystore
- Modify APK build command to include CI versioning
- Add logic to prepare release assets and upload to GitHub
- Update .gitignore to exclude build directories
- Introduce SettingsActivity for managing auto-update preferences
- Add UpdateManager for handling update checks and dialogs
- Integrate update check on app startup in MainActivity
This commit is contained in:
jahruz67
2026-05-21 16:21:21 -07:00
parent c1ad9c7a56
commit 9af47ed14a
8 changed files with 590 additions and 5 deletions
+35 -2
View File
@@ -26,18 +26,51 @@ jobs:
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Cache Android debug keystore
uses: actions/cache@v4
with:
path: ~/.android/debug.keystore
key: android-debug-keystore-${{ runner.os }}
- name: Make Gradle wrapper executable
run: chmod +x gradlew
- name: Build debug APK
run: ./gradlew assembleDebug
run: ./gradlew assembleDebug -PciVersionCode=${{ github.run_number }} -PciVersionName=1.0.${{ github.run_number }}
- name: Prepare release assets
shell: bash
run: |
VERSION_CODE="${{ github.run_number }}"
VERSION_NAME="1.0.${{ github.run_number }}"
APK_URL="https://github.com/jahruz67/Bible-Daily/releases/download/latest/app-debug.apk"
APK_PATH="$(find app/build/outputs/apk/debug -maxdepth 1 -name '*.apk' -print -quit)"
if [ -z "$APK_PATH" ]; then
echo "No APK found in app/build/outputs/apk/debug"
exit 1
fi
cp "$APK_PATH" app-debug.apk
cat > latest.json <<EOF
{
"versionCode": $VERSION_CODE,
"versionName": "$VERSION_NAME",
"apkUrl": "$APK_URL",
"commit": "${GITHUB_SHA}",
"builtAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
}
EOF
- name: Upload APK to latest release
uses: softprops/action-gh-release@v2
with:
tag_name: latest
name: Latest APK
files: app/build/outputs/apk/debug/app-debug.apk
files: |
app-debug.apk
latest.json
make_latest: true
overwrite_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}