apps/Android/MnnLlmChat/scripts/README.md
This directory contains scripts for building and releasing the MnnLlmChat Android application.
release.sh - Main release script for building and publishing the appbump_version.sh - Version bump helper for versionName and versionCodeupload-cdn.mjs - Upload APK to CDN (ali-oss)upload-market-config.mjs - Upload model_market.json to OSS (data/mnn/apis/model_market.json)release.config.example - Example configuration filesetup_release.sh - Setup script to help configure the release environmenttest_build.sh - Test script to verify build commands work correctlyget_repo_info.py - Utility script for getting repository informationSetup the release environment:
./scripts/setup_release.sh
Bump app version:
./scripts/bump_version.sh 0.7.7 752
Edit the configuration:
# Edit the configuration file with your actual values
nano scripts/release.config
Test the build commands:
./scripts/test_build.sh
Run the release process:
source scripts/release.config
./scripts/release.sh
The release.sh script automates building the standard flavor debug APK (for CDN) and the Google Play flavor release AAB (for Google Play Store).
Copy the example configuration file:
cp scripts/release.config.example scripts/release.config
Edit scripts/release.config with your actual values:
Source the configuration file before running the script:
source scripts/release.config
From the project root directory:
# Run the complete release process
./scripts/release.sh
release_outputs/
├── cdn/
│ └── app-standard-debug.apk
├── googleplay/
│ └── app-googleplay-release.aab
└── release_notes.md
The script uses the following environment variables (can be set in release.config):
KEYSTORE_FILE - Path to keystore fileKEYSTORE_PASSWORD - Keystore passwordKEY_ALIAS - Key aliasKEY_PASSWORD - Key passwordSet in ~/.zshrc or release.config. No bucket/region defaults in codebase.
CDN_ENDPOINT - Aliyun OSS endpointCDN_ACCESS_KEY - Aliyun OSS access key IDCDN_SECRET_KEY - Aliyun OSS access key secretCDN_BUCKET - OSS bucket nameCDN_OSS_PREFIX - (optional) OSS path prefix, default data/mnn/apksUpload path: {CDN_OSS_PREFIX}/mnn_chat_{version}.apk
CDN upload uses Node.js + ali-oss SDK (no ossutil required). Run npm install once in the project root to install dependencies.
GOOGLE_PLAY_SERVICE_ACCOUNT - Path to Google Play service account JSON fileGOOGLE_PLAY_PACKAGE_NAME - Google Play package namegradle wrapper to generate the wrapperIf the script fails, you can run individual steps manually:
# Build standard debug
./gradlew assembleStandardDebug
# Build Google Play bundle
./gradlew bundleGoogleplayRelease
# Clean build
./gradlew clean
release.config with actual credentialsFor CI/CD integration, set the environment variables in your CI/CD system and run:
source scripts/release.config
./scripts/release.sh
The script will automatically detect missing configurations and skip those steps while continuing with available builds.