1.6 KiB
1.6 KiB
description
| description |
|---|
| Build and release Android APK to Gitea |
Android Release Command
Build Android APK and upload to Gitea Release.
Prerequisites Check
First, verify the environment:
# Check GITEA_TOKEN
echo "GITEA_TOKEN: ${GITEA_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 current version
grep -h 'versionName' app/build.gradle.kts android/app/build.gradle.kts 2>/dev/null | head -1
# Check existing tags
git tag -l '*android*' -l 'v*' | tail -5
Release Process
If there are uncommitted changes:
- Increment version: update
versionCode(+1) andversionNameinapp/build.gradle.kts - Commit the changes with a descriptive message
- Create annotated git tag:
- Monorepo:
git tag -a android-{version} -m "Release notes" - Standalone:
git tag -a v{version} -m "Release notes"
- Monorepo:
- Push commit and tag:
git push && git push origin {tag}
If no uncommitted changes but tag doesn't exist:
- Create tag and push it
Build and Upload
After tag is created and pushed, run:
node ~/.config/opencode/bin/release-android.mjs
The script will:
- Auto-detect Android project root (standalone or monorepo)
- Auto-detect Gitea config from git remote URL (HTTPS/SSH)
- Auto-detect Java from Android Studio
- Build release APK
- Upload to Gitea Release
Error Handling
- If
GITEA_TOKENis not set:export GITEA_TOKEN="your_token" - If build fails: check Java/Android SDK installation
- If tag not found: create and push the tag first
$ARGUMENTS