Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ These commands automatically update all necessary files:
- `frontend/src-tauri/gen/apple/maple_iOS/Info.plist`
- `Cargo.lock` (via cargo check)

Android `versionCode` is internal and increments by one for each Play Store upload.
Use `just update-android-counter` for another internal/test build with the same visible version.

#### Creating a GitHub Release
1. Use one of the version commands above to update the version
2. Create a new release in GitHub:
Expand Down
15 changes: 8 additions & 7 deletions docs/android-platform-checks-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -957,11 +957,11 @@ Store in GitHub Secrets:

### Version Code Management

Tauri automatically generates version codes from `tauri.conf.json`:
- Formula: `versionCode = major * 1000000 + minor * 1000 + patch`
- Example: `1.3.2` → `1003002`
Android `versionCode` is not user-visible; `versionName`/Tauri `version` is what users see.
Google Play only requires that each uploaded build uses a higher `versionCode` than previous uploads
and stays at or below `2100000000`.

Override in `tauri.conf.json` if needed:
Set the override in `tauri.conf.json`:
```json
{
"bundle": {
Expand Down Expand Up @@ -997,9 +997,10 @@ Override in `tauri.conf.json` if needed:
- **Upload Key SHA256**: `C6:12:09:59:0A:27:73:F9:EA:EC:80:0A:C1:09:07:54:4A:56:6C:62:A5:68:7D:DF:9D:B3:DE:91:19:E4:3B:2A`

### Version Code Management:
To avoid conflicts with Tauri's automatic version code generation, we use an extended scheme:
- Base formula: `major*1000000 + minor*1000 + patch`
- Extended for builds: Add 3 digits for build number (e.g., 1003002001, 1003002002)
To avoid conflicts with Tauri's automatic version code generation and Google Play's
`2100000000` cap, Android builds use a simple sequential `versionCode`:
- Increment by one for each Play Store upload
- Keep the user-facing app version in Tauri `version`
- Configured in `tauri.conf.json` under `bundle.android.versionCode`

### Still Required for Full Release:
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "maple",
"private": true,
"version": "2.0.28",
"version": "3.0.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "maple"
version = "2.0.28"
version = "3.0.0"
description = "Maple AI"
authors = ["tony@trymaple.ai"]
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src-tauri/gen/apple/maple_iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.28</string>
<string>3.0.0</string>
<key>CFBundleVersion</key>
<string>2.0.28</string>
<string>3.0.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src-tauri/gen/apple/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ targets:
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
CFBundleShortVersionString: 2.0.28
CFBundleVersion: 2.0.28
CFBundleShortVersionString: 3.0.0
CFBundleVersion: 3.0.0
entitlements:
path: maple_iOS/maple_iOS.entitlements
scheme:
Expand Down
4 changes: 2 additions & 2 deletions frontend/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "Maple",
"version": "2.0.28",
"version": "3.0.0",
"identifier": "cloud.opensecret.maple",
"build": {
"frontendDist": "../dist",
Expand Down Expand Up @@ -89,7 +89,7 @@
"minimumSystemVersion": "16.0"
},
"android": {
"versionCode": 2000028000
"versionCode": 2000028001
},
"windows": {
"certificateThumbprint": null,
Expand Down
34 changes: 16 additions & 18 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,15 @@ update-version version:
# Parse version into components
IFS='.' read -r major minor patch <<< "{{version}}"

# Calculate Android versionCode: M + MMM (minor) + PPP (patch) + 000 (counter reset)
# Format: MMMMPPPCCC (10 digits total)
android_version_code=$(printf "%d%03d%03d000" "$major" "$minor" "$patch")
echo "Calculated Android versionCode: $android_version_code"
# Android versionCode is not user-visible. It only has to increase for
# every uploaded Play Store build and must stay <= 2100000000.
current_android_version_code=$(jq -r '.bundle.android.versionCode' frontend/src-tauri/tauri.conf.json)
android_version_code=$((current_android_version_code + 1))
if [ "$android_version_code" -gt 2100000000 ]; then
echo "Error: Android versionCode $android_version_code exceeds Google Play maximum 2100000000."
exit 1
fi
echo "Calculated Android versionCode: $android_version_code (previous + 1)"

# Update package.json
sed -i 's/"version": "[^"]*"/"version": "{{version}}"/' frontend/package.json
Expand Down Expand Up @@ -169,31 +174,24 @@ bump-major:

just update-version "$new_version"

# Increment Android versionCode counter (last 3 digits) for Play Store updates
# Increment Android versionCode for another Play Store upload with the same visible version
update-android-counter:
#!/usr/bin/env bash
set -euo pipefail

# Get current versionCode from tauri.conf.json
current_code=$(jq -r '.bundle.android.versionCode' frontend/src-tauri/tauri.conf.json)

# Extract base (first 7 digits) and counter (last 3 digits)
base=$((current_code / 1000))
counter=$((current_code % 1000))
# Increment by one. This value is internal to Android/Play Store and is not user-visible.
new_code=$((current_code + 1))

# Increment counter
new_counter=$((counter + 1))

# Ensure counter doesn't exceed 999
if [ $new_counter -gt 999 ]; then
echo "Error: Counter exceeds maximum (999). Consider bumping the version instead."
# Ensure versionCode stays within Google Play's maximum.
if [ "$new_code" -gt 2100000000 ]; then
echo "Error: Android versionCode $new_code exceeds Google Play maximum 2100000000."
exit 1
fi

# Calculate new versionCode
new_code=$((base * 1000 + new_counter))

echo "Updating Android versionCode: $current_code → $new_code"
echo "Updating Android versionCode: $current_code -> $new_code"

# Update tauri.conf.json Android versionCode
sed -i "s/\"versionCode\": $current_code/\"versionCode\": $new_code/" frontend/src-tauri/tauri.conf.json
Expand Down
Loading