mirror of
https://github.com/jahruz67/Bible-Daily.git
synced 2026-08-08 18:14:05 +00:00
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:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user