Repository navigation
Use the run number as Android version code and iOS build number - #284
ninovanhooff wants to merge 3 commits into
Conversation
Adds a prepare-release composite action that writes the run number (plus an optional offset) to appVersionCode in gradle.properties. The workflow passed -Papp.versionCodeOverride, which no build script read, so every build got version code 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the Android release-versioning changes.
No open issues 🎉
What changed in this PR
Fixes Android release versioning by writing the workflow run number to appVersionCode in gradle.properties, keeping release artifacts and shared build metadata consistent.
Changes:
- Adds a reusable release-preparation action with an optional version-code offset.
- Runs preparation before resolving Android version metadata.
- Removes unused Gradle version override flags from build and Firebase upload commands.
| File | Description |
|---|---|
.github/workflows/android-release.yml |
Prepares the version code before metadata resolution and removes unused overrides. |
.github/actions/prepare-release/action.yml |
Calculates, writes, and verifies the run-based version code. |
Review effort: Balanced
The prepare-release action now sets ORG_GRADLE_PROJECT_appVersionCode instead of rewriting gradle.properties. It applies to every later Gradle call in the job, without changing tracked files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runs the prepare-release action in the iOS release workflow, so CURRENT_PROJECT_VERSION and BuildKonfig's APP_VERSION_CODE use the run number instead of the version code 1 from gradle.properties. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
We have a repository with reusable Actions here: https://github.com/Q42/actions
If this is a GitHub Action that we want to use for every project, it might make sense to put it there, so we can update it in a single place and not have the code duplicated in every project repo.
There was a problem hiding this comment.
So your suggestion is to create an action there called q42/gradle-version-number and update the current PR to use it in the prepare-release action, right? I think I like that idea
Summary
The release workflows never overrode the version code, so every build had version code / build number 1 from
gradle.properties, and couldn't be installed over the previous build or uploaded to TestFlight again.android-release.ymlpassed-Papp.versionCodeOverrideand-Papp.versionNameOverride, but no build script reads those properties;androidAppandsharedreadappVersionCode/appVersionName.ios-release.ymlpassedCURRENT_PROJECT_VERSIONfromprintAppVersionMetadata, which just returned thegradle.propertiesvalue.Changes
prepare-releasecomposite action (based on the one in widm-android). It setsORG_GRADLE_PROJECT_appVersionCodetogithub.run_numberplus an optionalversioncode_offset. Gradle readsORG_GRADLE_PROJECT_*environment variables as project properties, which take precedence overgradle.properties. So every later Gradle call in the job gets the same value without changing tracked files, including theembedAndSignAppleFrameworkForXcodecall that Xcode starts.versionCodeCURRENT_PROJECT_VERSIONAPP_VERSION_CODEon both platforms-Papp.*Overrideflags from the Android workflow.Testing
Ported from Q42/GoingsOn.CMP#53:
…-v1.0.0-12-release-apk/-aab.version code: 10in the metadata step. The run then stopped at "Install code signing certificate" because that repository has no Apple secrets yet, so the archive and TestFlight upload were not exercised.ORG_GRADLE_PROJECT_appVersionCode=13 ./gradlew :shared:generateBuildKonfiggeneratedAPP_VERSION_CODE = 13, and1without the variable.Not yet run on this repository.
🤖 Generated with Claude Code