mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
fix: bump Android mobile versionCode
Agent-Logs-Url: https://github.com/we-promise/sure/sessions/c7b35fa9-a638-489b-803f-a935ccd7a301 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d809add5a1
commit
daaf4fb564
@@ -172,6 +172,8 @@ flutter build apk --release
|
||||
flutter build appbundle --release
|
||||
```
|
||||
|
||||
Android release metadata comes from `pubspec.yaml` (`version: <name>+<code>`). Keep the numeric build code increasing for every release so Android can install upgrades over older APKs.
|
||||
|
||||
### iOS
|
||||
|
||||
```bash
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: sure_mobile
|
||||
description: A mobile app for Sure personal finance management
|
||||
publish_to: 'none'
|
||||
version: 0.6.9+9
|
||||
version: 0.6.9+12
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
||||
25
mobile/test/versioning_test.dart
Normal file
25
mobile/test/versioning_test.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
test('Android versionCode stays above the last published release', () {
|
||||
final pubspec = File('pubspec.yaml').readAsStringSync();
|
||||
final versionMatch = RegExp(r'^version:\s*([^\s]+)$', multiLine: true).firstMatch(pubspec);
|
||||
|
||||
expect(versionMatch, isNotNull);
|
||||
|
||||
final version = versionMatch!.group(1)!;
|
||||
final versionParts = version.split('+');
|
||||
|
||||
expect(versionParts.length, 2);
|
||||
|
||||
final versionCode = int.parse(versionParts[1]);
|
||||
|
||||
expect(
|
||||
versionCode,
|
||||
greaterThan(11),
|
||||
reason: 'Android upgrades require monotonically increasing versionCode values; v0.6.8 shipped with versionCode 11.',
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user