Skip to content

Commit e8e7269

Browse files
authored
Merge pull request #87 from figonzal1/build/drop-beta-flavor-build-once-promote
build: drop beta flavor, build once and promote via Play Console
2 parents 5d3884d + cde51bb commit e8e7269

4 files changed

Lines changed: 34 additions & 32 deletions

File tree

.claude/commands/fastlane-changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ Generate the Fastlane changelog files before a Google Play release.
3535
6. Report a summary:
3636
- Files created or updated
3737
- Character count for each changelog (reminder: Google Play limit is 500 chars)
38-
- Next step hint: run `fastlane beta_googleplay` or `fastlane prod_googleplay`
38+
- Next step hint: run `fastlane release` then `fastlane beta_googleplay` (production is
39+
reached by promoting that same build in Play Console, not by rebuilding)

CLAUDE.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ expose `DomainResult<T>` (success/error), surfaced to ViewModels as a single `ui
2626

2727
## Commands
2828

29-
Build uses product flavors `dev` / `beta` / `prod` (dimension `version`) and build types `debug` / `release`.
29+
Build uses product flavors `dev` / `prod` (dimension `version`) and build types `debug` / `release`.
3030

3131
The toolchain is pinned in `mise.toml`: **Java temurin-21** (Gradle JVM — `compileOptions` and
3232
`jvmTarget` stay at 17, that is the bytecode level) and **Ruby 3.4** (fastlane/bundler).
@@ -40,7 +40,8 @@ The toolchain is pinned in `mise.toml`: **Java temurin-21** (Gradle JVM — `com
4040
# fastlane wrappers (bundle exec):
4141
bundle exec fastlane unit_test # unit tests
4242
bundle exec fastlane ui_test # instrumentation tests (DevDebug)
43-
bundle exec fastlane prod_googleplay # build prod AAB + upload to Google Play
43+
bundle exec fastlane release # build the prodRelease AAB (used for every track)
44+
bundle exec fastlane beta_googleplay # upload that AAB to the beta track
4445
```
4546

4647
## Gotchas
@@ -53,9 +54,17 @@ bundle exec fastlane prod_googleplay # build prod AAB + upload to Google Play
5354
`signingConfig`. Fastlane deliberately does not inject `android.injected.signing.*` — a second
5455
copy of the keystore path drifts per machine, and `-P` properties leak the passwords into the
5556
build log. The only property the build lanes pass is `uploadMapping`.
56-
- The Crashlytics mapping is uploaded **only** when `-PuploadMapping` is set (the `beta` and `prod`
57-
fastlane lanes pass it). Local release builds skip it so they don't overwrite the mapping of the
57+
- The Crashlytics mapping is uploaded **only** when `-PuploadMapping` is set (the `release`
58+
fastlane lane passes it). Local release builds skip it so they don't overwrite the mapping of the
5859
same `versionCode` in Firebase.
60+
- **Build once, promote.** There is a single release artifact — `prodRelease` — and it is what
61+
every Play track gets. Do not reintroduce a per-track flavor or `versionNameSuffix`: Play
62+
rejects a second upload with the same `versionCode`, so a track-specific binary forces a version
63+
bump between beta and production and the tested bits stop being the shipped bits.
64+
- Side-by-side installs come from the **`debug` build type** (`applicationIdSuffix = ".debug"`),
65+
not from the flavor. `devDebug` is `cl.figonzal.lastquakechile.debug` and both package names are
66+
registered in `app/google-services.json` — moving that suffix onto the `dev` flavor would leave
67+
`prodDebug` holding the production applicationId.
5968

6069
## Release process (release-please + fastlane + Google Play)
6170

@@ -100,7 +109,12 @@ Use the `/fastlane-changelog` command (see `.claude/commands/fastlane-changelog.
100109
3. Commit those `default.txt` files as the final commit onto the release PR branch.
101110
4. **Merge the release PR** (`gh pr merge <n> --merge` or the GitHub UI) → creates the tag,
102111
GitHub Release, and `versionCode` bump.
103-
5. Build and upload: `fastlane prod_googleplay` (or `beta_googleplay`) — reads `default.txt`.
112+
5. Build and upload to beta: `fastlane release` then `fastlane beta_googleplay` — reads
113+
`default.txt`. In Play Console the release can be *named* `1.8.0-beta`; that label is separate
114+
from the AAB's `versionName` and is editable when promoting.
115+
6. Test on the beta track, then **promote in Play Console** (Production → Create release → Add
116+
from library → pick that `versionCode`). No rebuild, no second upload: production ships the
117+
exact bits the testers ran. `prod_googleplay` is only for a version that skips beta entirely.
104118

105119
## Conventions
106120

app/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ android {
105105
dimension = "version"
106106
versionNameSuffix = "-dev"
107107
}
108-
create("beta") {
109-
dimension = "version"
110-
versionNameSuffix = "-beta"
111-
}
112108
create("prod") {
113109
dimension = "version"
114110
}

fastlane/Fastfile

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,44 +36,35 @@ platform :android do
3636
)
3737
end
3838

39-
desc "Build beta version"
40-
lane :beta do
39+
desc "Build release version (el mismo AAB para beta y produccion)"
40+
lane :release do
4141
build_android_app(task: "clean")
4242
build_android_app(
43-
task: 'bundle',
44-
flavor: 'beta',
45-
build_type: 'Release',
46-
properties: {
47-
"uploadMapping" => "true",
43+
task: 'bundle',
44+
flavor: 'prod',
45+
build_type: 'Release',
46+
properties: {
47+
"uploadMapping" => "true",
4848
}
4949
)
5050
end
5151

52+
# Un versionCode se sube con UNA sola de estas dos lanes. El camino normal es
53+
# beta_googleplay y despues promover en Play Console; reusar prod_googleplay sobre
54+
# un versionCode ya subido falla con "version code already used".
55+
5256
desc "Deploy Beta to the Google Play"
5357
lane :beta_googleplay do
5458
upload_to_play_store(
5559
release_status: 'draft',
5660
track: 'beta',
57-
aab: 'app/build/outputs/bundle/betaRelease/app-beta-release.aab',
61+
aab: 'app/build/outputs/bundle/prodRelease/app-prod-release.aab',
5862
skip_upload_screenshots: true,
5963
skip_upload_images: true
6064
)
6165
end
6266

63-
desc "Build production version"
64-
lane :prod do
65-
build_android_app(task: "clean")
66-
build_android_app(
67-
task: 'bundle',
68-
flavor: 'prod',
69-
build_type: 'Release',
70-
properties: {
71-
"uploadMapping" => "true",
72-
}
73-
)
74-
end
75-
76-
desc "Deploy Production to the Google Play"
67+
desc "Deploy Production to the Google Play (solo si no paso por beta)"
7768
lane :prod_googleplay do
7869
upload_to_play_store(
7970
release_status: 'draft',

0 commit comments

Comments
 (0)