Skip to content

Add rn-build-version to default template for auto upgrade version #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

getsettalk
Copy link
Contributor

Summary:

Integrating rn-build-version into the React Native community template will streamline the management of Android build versions (versionCode and versionName) directly within the development workflow. This tool offers interactive prompts for version increments, automates backups, and updates changelogs, thereby enhancing the efficiency and reliability of the build process for developers.

Changelog:

  • Added: Inclusion of rn-build-version as a development dependency in the React Native community template to facilitate automated Android version management.

Pick one each for the category and type tags:

[ADDED] - Message

Test Plan:

  1. Initialize a New React Native Project Using the Updated Template:

    npx @react-native-community/cli@latest init TestApp
  2. Verify the Installation of rn-build-version:

    • Navigate to the project directory:
      cd TestApp
    • Check package.json to confirm rn-build-version is listed under devDependencies.
    • Run npm install or yarn install to ensure all dependencies, including rn-build-version, are properly installed.
  3. Execute Build Commands Utilizing rn-build-version:

    • Add the following scripts to the package.json under the scripts section: (if you are not using this git repo)
      {
        "scripts": {
          "build:android:apk": "rn-build-version && cd android && ./gradlew clean assembleRelease",
          "build:android:aab": "rn-build-version && cd android && ./gradlew clean bundleRelease"
        }
      }
    • Run the production build command:
      npm run build:android:apk
    • During execution, confirm that rn-build-version prompts for version increment options and updates the build.gradle file accordingly.
    • Verify that the build artifacts (.apk or .aab files) are generated successfully in the android/app/build/outputs directory.
  4. Validate Changelog and Backup Creation:

    • Ensure that a backup of the build.gradle file (build.gradle.bak) is created in the android/app directory.
    • Check for the existence and content of the CHANGELOG.md file to confirm that version details are accurately appended.

By following this test plan, we can ensure that integrating rn-build-version into the React Native community template enhances the Android build process, providing developers with a more streamlined and automated approach to version management.

@cortinico
Copy link
Member

https://github.com/getsettalk/rn-build-version this tool is 3 days old and has 1 star on GitHub. We add to the template only tools that widely adopted by the ecosystem

@cortinico cortinico closed this Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants