Skip to content

[NREM][Space] Add CI check for cross-file version consistency #3391

@numbers-official

Description

@numbers-official

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:

  1. Extracts the version from package.json
  2. Verifies versionName in build.gradle matches
  3. Verifies MARKETING_VERSION in project.pbxproj matches
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    nremNREM Mode findingnrem:improvementGeneral improvementnrem:spaceSpace-level nrem finding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions