| name | prepare-mobile-release |
| description | Prepare a CommonEx mobile release (Android + iOS): bump version on both platforms, generate Android baseline profiles, and create/push a release tag. Use when the user asks to prepare a mobile release or run the release SOP. Requires RELEASE_VERSION, PATCH, RUN_FROM (repo-root or android/), and SHELL. |
Prepare Mobile Release
Overview
Follow the mobile release SOP: bump version on Android and iOS in lockstep, generate Android baseline profiles, then tag and push. Both platforms share the same version number and build number.
Required inputs (ask only for missing values)
- RELEASE_VERSION: YYYY-MM-N
- PATCH: integer patch number for the tag (1 for normal release; increment only for hotfixes)
- RUN_FROM: repo-root or android/
- SHELL: PowerShell or bash
Derived values
- VERSION_NAME = YYYY.MM.N (from RELEASE_VERSION)
- VERSION_CODE = CURRENT_VERSION_CODE + 1
- TAG = release/YYYY-MM-N/P (VERSION_NAME with dots replaced by hyphens + PATCH)
- PATH_PREFIX = "" if RUN_FROM = android/, otherwise "android/"
- IOS_PROJECT = PATH_PREFIX + "iosApp/iosApp.xcodeproj/project.pbxproj"
- GRADLEW_CMD (always append
--quiet):
- repo-root + PowerShell: .\android\gradlew -p android --quiet
- repo-root + bash: ./android/gradlew -p android --quiet
- android/ + PowerShell: .\gradlew --quiet
- android/ + bash: ./gradlew --quiet
Preconditions (stop if any fail)
- On branch main and up to date with origin/main
- All Android and iOS changes are committed (other changes may remain)
- Android SDK and a managed device for baseline profiles are available
Workflow
Step 1: Bump version (Android + iOS)
- Read PATH_PREFIXapp/build.gradle.kts for CURRENT_VERSION_CODE.
- Edit PATH_PREFIXapp/build.gradle.kts:
- versionCode = VERSION_CODE
- versionName = "VERSION_NAME"
- Edit IOS_PROJECT (both Debug and Release build configurations):
- Commit (exact message format):
- git add PATH_PREFIXapp/build.gradle.kts IOS_PROJECT
- git commit -m "Bump version to VERSION_NAME"
Step 2: Generate baseline/startup profiles (Android)
- Run:
- GRADLEW_CMD --quiet :app:generateBaselineProfile
- Verify:
- Build succeeds ("BUILD SUCCESSFUL")
- Files updated:
- PATH_PREFIXapp/src/release/generated/baselineProfiles/baseline-prof.txt
- PATH_PREFIXapp/src/release/generated/baselineProfiles/startup-prof.txt
- PATH_PREFIXapp/src/autotest/generated/baselineProfiles/baseline-prof.txt
- PATH_PREFIXapp/src/autotest/generated/baselineProfiles/startup-prof.txt
- Commit (exact message format):
- git add PATH_PREFIXapp/src/release/generated/baselineProfiles/ PATH_PREFIXapp/src/autotest/generated/baselineProfiles/
- git commit -m "Update baseline and startup profiles for version VERSION_NAME"
Step 3: Tag and push
- Create tag locally:
- Push commits:
- Ask for user confirmation before pushing tag. The tag does not trigger deployment; push only after manual deployment:
Stop conditions
- If any command fails, stop and report the error; do not proceed.
Troubleshooting (short)
- Profile generation fails: verify RUN_FROM and GRADLEW_CMD, ensure the emulator is available, then re-run.
- Tag conflict: list existing tags with git tag -l "release/*" and bump PATCH or RELEASE_VERSION as needed.