|
1 | 1 | # MoveTopia |
2 | 2 |
|
3 | | - |
| 3 | + |
| 4 | + |
| 5 | +## CI/CD and Versioning |
| 6 | + |
| 7 | +The MoveTopia project uses an automated CI/CD system with Fastlane and GitHub Actions for a consistent build and release pipeline. |
| 8 | + |
| 9 | +### Versioning System |
| 10 | + |
| 11 | +Our version numbers follow this format: |
| 12 | + |
| 13 | +``` |
| 14 | +YYYY.MM.DD+HOTFIX |
| 15 | +``` |
| 16 | + |
| 17 | +Example: `2025.04.03+0` |
| 18 | + |
| 19 | +- **YYYY.MM.DD**: Date of the build |
| 20 | +- **HOTFIX**: A number that is automatically incremented when multiple builds are created on the same day |
| 21 | + |
| 22 | +### Fastlane |
| 23 | + |
| 24 | +For build process automation, we use [Fastlane](https://fastlane.tools/). The configuration is located in the `android/fastlane` directory. |
| 25 | + |
| 26 | +#### Main Features of Fastlane |
| 27 | + |
| 28 | +- **Automatic Version Generation**: Based on the current date and existing Git tags |
| 29 | +- **Android Build Configuration**: Updates the `local.properties` file for the native Android build (not tracked by Git) |
| 30 | +- **Flutter Version**: Generates a `version.dart` file with all version information for the app |
| 31 | + |
| 32 | +Details on the Fastlane configuration can be found in [android/fastlane/README.md](android/fastlane/README.md). |
| 33 | + |
| 34 | +#### Available Lanes |
| 35 | + |
| 36 | +- `build_debug`: Creates a debug build of the app |
| 37 | +- `build_release`: Creates a release build of the app |
| 38 | +- `build_debug_with_release`: Creates a debug build with complete version information |
| 39 | +- `build_release_with_release`: Creates a release build with complete version information |
| 40 | + |
| 41 | +### GitHub Actions |
| 42 | + |
| 43 | +The project uses GitHub Actions for automated builds and releases. The workflows are located in the `.github/workflows/` directory. |
| 44 | + |
| 45 | +#### Debug Build Workflow |
| 46 | + |
| 47 | +File: `.github/workflows/build-android-debug.yml` |
| 48 | + |
| 49 | +This workflow is automatically triggered: |
| 50 | +- On every push to the `main` branch |
| 51 | +- On pull requests to the `main` branch |
| 52 | +- Manually through the GitHub interface |
| 53 | + |
| 54 | +Features: |
| 55 | +- Creates a debug APK |
| 56 | +- Uploads the build as an artifact |
| 57 | +- Creates a GitHub release with a tag in the format `YYYY.MM.DD+HOTFIX` |
| 58 | +- Marks releases as "Pre-release" |
| 59 | + |
| 60 | +#### Release Build Workflow |
| 61 | + |
| 62 | +File: `.github/workflows/build-android-release.yml` |
| 63 | + |
| 64 | +This workflow is only triggered manually and creates official releases. |
| 65 | + |
| 66 | +Features: |
| 67 | +- Creates a release APK |
| 68 | +- Uploads the build as an artifact |
| 69 | +- Creates a GitHub release with a tag in the format `YYYY.MM.DD+HOTFIX` |
| 70 | +- Creates an official release (not marked as pre-release) |
| 71 | + |
| 72 | +### Manual Version Adjustment |
| 73 | + |
| 74 | +If you want to set a specific version for a build, you have the following options: |
| 75 | + |
| 76 | +1. **Via local.properties**: |
| 77 | + Edit the file `android/local.properties` and set: |
| 78 | + ``` |
| 79 | + flutter.versionName=YOUR.VERSION.HERE.0 |
| 80 | + flutter.versionCode=YOURCODENUMBER |
| 81 | + ``` |
| 82 | + Note: This file is ignored by Git and won't be pushed to the repository. |
| 83 | + |
| 84 | +2. **Via Environment Variables**: |
| 85 | + Set the following environment variables before running Fastlane: |
| 86 | + ```bash |
| 87 | + export VERSION_NAME="2025.04.03+1" |
| 88 | + export BUILD_NUMBER="2025040301" |
| 89 | + ``` |
| 90 | + |
| 91 | +3. **Directly in the GitHub Workflow**: |
| 92 | + You can manually define values for env.VERSION_NAME by customizing the workflow. |
| 93 | + |
| 94 | +**Note**: After a manual version update, you should synchronize your local repository with the current changes. |
0 commit comments