ChangeVersion Tutorial: Managing App Versions Without the Stress
App development is exhilarating until you have to manage version releases. Manual versioning often leads to skipped numbers, broken builds, and mismatched tags between your code and your repository.
ChangeVersion solves this problem by automating the versioning workflow. This tutorial will guide you through setting up and using ChangeVersion to eliminate deployment stress. What is ChangeVersion?
ChangeVersion is a lightweight command-line interface (CLI) tool. It synchronizes version numbers across your configuration files, source code, and Git tags simultaneously. Step 1: Installation
Get started by installing ChangeVersion globally via your package manager. npm install -g changeversion Use code with caution. Verify the installation by checking the version. changeversion –version Use code with caution. Step 2: Configuration
Create a configuration file in your project root to tell ChangeVersion which files to update. Name this file .changeversionjson.
{ “currentVersion”: “1.0.0”, “files”: [ “package.json”, “src/constants/version.ts”, “sonar-project.properties” ] } Use code with caution. Step 3: Updating Versions
ChangeVersion uses Semantic Versioning (Major.Minor.Patch). You can bump your version safely using single commands. Patch Releases
Use this for backwards-compatible bug fixes. It changes 1.0.0 to 1.0.1. changeversion patch Use code with caution. Minor Releases
Use this for adding functionality in a backwards-compatible manner. It changes 1.0.0 to 1.1.0. changeversion minor Use code with caution. Major Releases
Use this for incompatible API changes. It changes 1.0.0 to 2.0.0. changeversion major Use code with caution. Step 4: Automating Git Tags
You can chain ChangeVersion with Git to automate your release tagging. Add this script to your package.json file:
“scripts”: { “release:minor”: “changeversion minor && git add . && git commit -m ‘Bump version’ && git tag v$(changeversion current)” } Use code with caution.
Running npm run release:minor will now update your files, commit the changes, and create a matching Git tag automatically. Best Practices for Stress-Free Releases
Integrate with CI/CD: Run ChangeVersion inside your GitHub Actions or GitLab CI pipelines to prevent human error.
Keep Configuration Updated: Whenever you add a new configuration or documentation file that references the version string, add it to your .changeversionjson targets.
Verify Before Pushing: Use a dry-run flag if available, or review your Git diff before pushing updates to production. To tailor this setup to your specific workflow, tell me:
What programming language or framework is your app built with?
Leave a Reply