Summary
Capture Cam's version number must be kept in sync across 4 files:
package.json (version field)
android/app/build.gradle (versionName / versionCode)
ios/App/App.xcodeproj/project.pbxproj (MARKETING_VERSION / CURRENT_PROJECT_VERSION)
CHANGELOG.md (latest heading)
Currently there is no automated check to ensure these stay consistent, which creates a risk of version drift — especially when bumping versions manually.
Proposal
Add a CI step (or a pre-commit hook) that:
- Extracts the version from
package.json
- Verifies
versionName in build.gradle matches
- Verifies
MARKETING_VERSION in project.pbxproj matches
- Optionally verifies the latest
CHANGELOG.md heading matches
This could be a simple shell script in .github/workflows/test.yml:
- name: Version consistency check
run: |
PKG_VERSION=$(node -p "require('./package.json').version")
GRADLE_VERSION=$(grep -oP 'versionName "\K[^"]+' android/app/build.gradle)
IOS_VERSION=$(grep -oP 'MARKETING_VERSION = \K[^;]+' ios/App/App.xcodeproj/project.pbxproj | head -1 | tr -d ' ')
echo "package.json: $PKG_VERSION"
echo "build.gradle: $GRADLE_VERSION"
echo "project.pbxproj: $IOS_VERSION"
if [ "$PKG_VERSION" != "$GRADLE_VERSION" ] || [ "$PKG_VERSION" != "$IOS_VERSION" ]; then
echo "::error::Version mismatch detected!"
exit 1
fi
Evidence
- Conversation
94e7c39a (Capture Cam Google Play 版本確認) documented the 4-file version management requirement
- Version bump commits (e.g.,
148563e8 chore: bump app version to 0.104.2) update these files manually
Generated by NREM Mode with Omni
Summary
Capture Cam's version number must be kept in sync across 4 files:
package.json(version field)android/app/build.gradle(versionName / versionCode)ios/App/App.xcodeproj/project.pbxproj(MARKETING_VERSION / CURRENT_PROJECT_VERSION)CHANGELOG.md(latest heading)Currently there is no automated check to ensure these stay consistent, which creates a risk of version drift — especially when bumping versions manually.
Proposal
Add a CI step (or a pre-commit hook) that:
package.jsonversionNameinbuild.gradlematchesMARKETING_VERSIONinproject.pbxprojmatchesCHANGELOG.mdheading matchesThis could be a simple shell script in
.github/workflows/test.yml:Evidence
94e7c39a(Capture Cam Google Play 版本確認) documented the 4-file version management requirement148563e8 chore: bump app version to 0.104.2) update these files manuallyGenerated by NREM Mode with Omni