{"id":26763438,"url":"https://github.com/getsettalk/rn-build-version","last_synced_at":"2026-05-11T03:16:14.112Z","repository":{"id":284733699,"uuid":"955806252","full_name":"getsettalk/rn-build-version","owner":"getsettalk","description":"A React Native tool for managing versionCode and versionName in your Android build.gradle file, with support for building APKs and AABs. It simplifies version management by providing interactive prompts and automates backups and changelog updates.","archived":false,"fork":false,"pushed_at":"2025-03-27T12:13:54.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T12:23:53.018Z","etag":null,"topics":["android","auto","ios","react-native","react-native-build","rn","rn-build-version","upgrade-build-version"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rn-build-version","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getsettalk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-27T08:22:06.000Z","updated_at":"2025-03-27T12:13:58.000Z","dependencies_parsed_at":"2025-03-27T12:23:56.384Z","dependency_job_id":"dba1472c-0383-462b-92d4-940db3962509","html_url":"https://github.com/getsettalk/rn-build-version","commit_stats":null,"previous_names":["getsettalk/rn-build-version"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsettalk%2Frn-build-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsettalk%2Frn-build-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsettalk%2Frn-build-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsettalk%2Frn-build-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getsettalk","download_url":"https://codeload.github.com/getsettalk/rn-build-version/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246085645,"owners_count":20721213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","auto","ios","react-native","react-native-build","rn","rn-build-version","upgrade-build-version"],"created_at":"2025-03-28T19:18:12.910Z","updated_at":"2026-05-11T03:16:14.100Z","avatar_url":"https://github.com/getsettalk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"1020\" height=\"661\" alt=\"image\" src=\"https://github.com/user-attachments/assets/9d9d6a4c-e3a0-4be0-ad9a-20262941cc97\" /\u003e\n\n# rn-build-version\n\nA React Native tool for managing `versionCode` and `versionName` in your Android `build.gradle` file, with support for building APKs and AABs. It simplifies version management by providing interactive prompts and automates backups and changelog updates.\n\n## 🚀 Features\n- **Version Management**:\n  - Increment patch (e.g., `0.0.1` → `0.0.2`), minor (e.g., `0.0.1` → `0.1.0`), or major (e.g., `0.0.1` → `1.0.0`) versions.\n  - Set custom `versionCode` and `versionName`.\n  - Skip version updates for local testing builds.\n- **Automation**:\n  - Backup `build.gradle` before modifications.\n  - Generate or update a `CHANGELOG.md` file with version details.\n- **Flexibility**:\n  - Custom Gradle file path support via CLI option.\n  - Dry-run mode to simulate changes without applying them.\n\n## 📌 Prerequisites\n- Ensure your build.gradle contains `versionCode` and `versionName` (e.g., in `defaultConfig`).\n- Configure signing in `build.gradle` for release builds.\n\n### ⚠️ Notes\n- The tool assumes a standard React Native Android project structure.\n- Run `chmod +x android/gradlew` on macOS/Linux if Gradle permissions are an issue.\n\n## 📦 Installation\n\nInstall the package globally or as a development dependency in your React Native project:\n\n```bash\n# Globally\nnpm install -g rn-build-version\n\n# As a dev dependency\nnpm install --save-dev rn-build-version\n\n# Using yarn\nyarn add --dev rn-build-version\n```\n\n## 🔧 Usage\n\n### 1️⃣ Add Scripts to Your `package.json`\nIntegrate the tool into your React Native project by adding these scripts:\n\n```json\n{\n  \"scripts\": {\n    \"build:android:apk\": \"rn-build-version \u0026\u0026 cd android \u0026\u0026 ./gradlew clean assembleRelease\",\n    \"build:android:aab\": \"rn-build-version \u0026\u0026 cd android \u0026\u0026 ./gradlew clean bundleRelease\",\n    \"build:android:apk:fast\": \"rn-build-version \u0026\u0026 cd android \u0026\u0026 ./gradlew assembleRelease\",\n    \"build:android:aab:fast\": \"rn-build-version \u0026\u0026 cd android \u0026\u0026 ./gradlew bundleRelease\",\n    \"build:android:apk:local\": \"cd android \u0026\u0026 ./gradlew clean assembleRelease\",\n    \"build:android:aab:local\": \"cd android \u0026\u0026 ./gradlew clean bundleRelease\",\n    \"build:android:apk:local:fast\": \"cd android \u0026\u0026 ./gradlew assembleRelease\",\n    \"build:android:aab:local:fast\": \"cd android \u0026\u0026 ./gradlew bundleRelease\"\n  }\n}\n```\n\n### 2️⃣ Run the Commands\n#### 🚀 Production Builds (with Version Management)\n```bash\nnpm run build:android:apk\nnpm run build:android:aab\n\nyarn build:android:apk\nyarn build:android:aab\n```\nThese commands prompt you to update the version before building.\n\n#### 🛠️ Local Testing Builds (No Version Change)\n```bash\nnpm run build:android:apk:local\nnpm run build:android:aab:local\n\nyarn build:android:apk:local\nyarn build:android:aab:local\n```\nThese skip version prompts and build with the current version.\n\n#### ⚡ Fast Builds (No Clean, for Quicker Iteration)\n```bash\nnpm run build:android:apk:fast\nnpm run build:android:aab:fast\nnpm run build:android:apk:local:fast\nnpm run build:android:aab:local:fast\n\nyarn build:android:apk:fast\nyarn build:android:aab:fast\nyarn build:android:apk:local:fast\nyarn build:android:aab:local:fast\n```\n\n## 📊 When to Use Each Command\n\n| Command | Use Case |\n|---------|---------|\n| `yarn build:android:apk` | Full build with version update and clean (ideal for production APK). |\n| `yarn build:android:aab` | Full build with version update and clean (ideal for production AAB). |\n| `yarn build:android:apk:fast` | Quick build with version update, no clean (faster for testing APK). |\n| `yarn build:android:aab:fast` | Quick build with version update, no clean (faster for testing AAB). |\n| `yarn build:android:apk:local` | Local build with clean, no version update (fresh APK for local use). |\n| `yarn build:android:aab:local` | Local build with clean, no version update (fresh AAB for local use). |\n| `yarn build:android:apk:local:fast` | Fast local build, no clean or version update (quick APK iteration). |\n| `yarn build:android:aab:local:fast` | Fast local build, no clean or version update (quick AAB iteration). |\n\n## 🖥️ CLI Usage\n\nRun the tool directly with options:\n```bash\nrn-build-version [options]\n```\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `-g, --gradle \u003cpath\u003e` | Path to your `build.gradle` file | `android/app/build.gradle` |\n| `-d, --dry-run` | Simulate changes without applying them | `false` |\n\n### 📌 Examples\n\n- Use a custom Gradle path:\n```bash\nrn-build-version --gradle ./custom/path/build.gradle\n```\n\n- Simulate changes (dry-run):\n```bash\nrn-build-version --dry-run\n```\n\n- Combine options:\n```bash\nrn-build-version --gradle ./android/app/build.gradle --dry-run\n```\n\n## ✨ Example Interaction\n\nWhen you run `rn-build-version` or a build script with it, you’ll see:\n\n```\nCurrent versionCode: 1\nCurrent versionName: 0.0.1\n? What do you want to do with the version? (Use arrow keys)\n  \u003e Increment patch (e.g., 0.0.1 -\u003e 0.0.2)\n    Increment minor (e.g., 0.0.1 -\u003e 0.1.0)\n    Increment major (e.g., 0.0.1 -\u003e 1.0.0)\n    Set custom version\n    Skip (no increment)\n```\n\n- Choosing **\"Increment patch\"**:\n    - Updates `versionCode: 2`, `versionName: \"0.0.2\"`.\n    - Creates a backup (`build.gradle.bak`).\n    - Appends to `CHANGELOG.md`.\n\n- Choosing **\"Set custom version\"**:\n    - Prompts for new `versionName` and `versionCode`.\n    - Example: Set `versionName: \"1.2.3\"`, `versionCode: 123`.\n\n---\n\n💡 **Enjoy hassle-free versioning in your React Native projects! 🚀**\n\n--- \n### Screenshots\n\n\n\u003cp align=\"center\"\u003e\n\n  \u003cimg src=\"https://github.com/user-attachments/assets/09587298-f6a0-457f-b9cd-522cf5577ff2\" width=\"45%\" /\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/e2b31f89-f11f-423f-819f-6aeb670210ae\" width=\"45%\" /\u003e\n\u003c/p\u003e\n\n\n---\nFixed: Now this will work all type of version naming convension.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetsettalk%2Frn-build-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetsettalk%2Frn-build-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetsettalk%2Frn-build-version/lists"}