1.4 KiB
1.4 KiB
description
| description |
|---|
| Build and release Android APK to Gitea (generic for any Android project) |
Android Release Command
Build Android APK and upload to Gitea Release for the current directory's Android project.
Prerequisites
Before running this command:
- Create and push the git tag first (e.g.,
myapp-1.0.0,android-1.0.0, orv1.0.0) - Ensure
GITEA_API_TOKENenvironment variable is set - Ensure Android project exists in current directory
Check the environment:
# Check GITEA_API_TOKEN
echo "GITEA_API_TOKEN: ${GITEA_API_TOKEN:+SET}"
# Check current directory for Android project
ls -la app/build.gradle.kts 2>/dev/null || ls -la android/app/build.gradle.kts 2>/dev/null || echo "No Android project found"
# Check recent tags (script will use the latest tag)
git tag -l | tail -10
Build and Upload
After creating and pushing the tag, run:
node ~/.opencode/bin/release-android.mjs
The script will:
- Auto-detect Android project root (standalone or monorepo)
- Auto-detect project name from recent git tags or directory name
- Auto-detect Gitea config from git remote URL (HTTPS/SSH)
- Auto-detect Java from Android Studio
- Build release APK
- Upload to Gitea Release matching the tag pattern
Error Handling
- If
GITEA_API_TOKENis not set:export GITEA_API_TOKEN="your_token" - If build fails: check Java/Android SDK installation
- If tag not found: create and push the tag first
$ARGUMENTS