Skip to content

Commit f3b4331

Browse files
authored
Merge pull request #3249 from wgqqqqq/wgq/mobile-account-signin
chore(mobile): set app versions to 1.0.0
2 parents 71bc498 + 5cc6bd7 commit f3b4331

7 files changed

Lines changed: 37 additions & 31 deletions

File tree

‎scripts/release-channel.test.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ exclude = ["src/apps/relay-server", "OpenBitFun-Installer/src-tauri"]
163163
);
164164
assert.match(
165165
readFileSync(path.join(root, 'src/apps/mobile/android/app/build.gradle.kts'), 'utf8'),
166-
/versionName = "1\.1\.0-beta\.2"/,
166+
/versionName = "1\.0\.0"/,
167167
);
168168
assert.match(
169169
readFileSync(path.join(root, 'src/apps/mobile/ios/OpenBitFun/Info.plist'), 'utf8'),
170-
/<string>1\.1\.0-beta\.2<\/string>/,
170+
/<string>1\.0\.0<\/string>/,
171171
);
172172
assert.match(
173173
readFileSync(path.join(root, 'src/apps/mobile/harmonyos/AppScope/app.json5'), 'utf8'),
174-
/"versionName": "1\.1\.0-beta\.2"/,
174+
/"versionName": "1\.0\.0"/,
175175
);
176176
assert.match(
177177
readFileSync(path.join(root, 'Cargo.lock'), 'utf8'),

‎scripts/set-build-version.mjs‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,6 @@ export function setBuildVersion(root, version) {
5151
);
5252
}
5353

54-
replaceVersion(
55-
path.join(root, 'src/apps/mobile/android/app/build.gradle.kts'),
56-
/^(\s*versionName\s*=\s*")[^"]+(".*)$/m,
57-
`$1${version}$2`,
58-
);
59-
replaceVersion(
60-
path.join(root, 'src/apps/mobile/ios/OpenBitFun/Info.plist'),
61-
/(<key>CFBundleShortVersionString<\/key>\s*<string>)[^<]+(<\/string>)/m,
62-
`$1${version}$2`,
63-
);
64-
replaceVersion(
65-
path.join(root, 'src/apps/mobile/harmonyos/AppScope/app.json5'),
66-
/^(\s*"versionName"\s*:\s*")[^"]+(".*)$/m,
67-
`$1${version}$2`,
68-
);
69-
7054
syncCargoLock(root);
7155
}
7256

‎scripts/tauri-release-manifest.test.mjs‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,24 @@ import test from 'node:test';
77

88
const root = path.resolve(import.meta.dirname, '..');
99

10-
test('release version metadata is synchronized', () => {
10+
test('desktop and mobile release metadata are synchronized within their own groups', () => {
1111
const version = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')).version;
12-
const result = run('scripts/verify-release-version-sync.mjs', ['--version', version]);
12+
const result = run('scripts/verify-release-version-sync.mjs', [
13+
'--version', version,
14+
'--mobile-version', '1.0.0',
15+
]);
1316
assert.equal(result.status, 0, result.stderr);
1417
});
1518

19+
test('mobile release metadata rejects drift within the mobile group', () => {
20+
const result = run('scripts/verify-release-version-sync.mjs', [
21+
'--version', JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')).version,
22+
'--mobile-version', '1.0.1',
23+
]);
24+
assert.notEqual(result.status, 0);
25+
assert.match(result.stderr, /expected mobile 1\.0\.1/);
26+
});
27+
1628
test('prepares a versioned custom Windows installer asset', () => {
1729
const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'openbitfun-manual-installer-'));
1830
const assets = path.join(temp, 'assets', 'nested');

‎scripts/verify-release-version-sync.mjs‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import { readFileSync } from 'fs';
33

44
const args = parseArgs(process.argv.slice(2));
5+
// Desktop release workflows resolve their version from the root package. Mobile
6+
// apps ship on their own cadence, so they form a separate consistency group.
57
const expected = args.version || readJsonVersion('package.json');
68
const versions = new Map([
79
['package.json', readJsonVersion('package.json')],
@@ -15,6 +17,9 @@ const versions = new Map([
1517
['src/apps/relay-server/Cargo.toml', readTomlVersion('src/apps/relay-server/Cargo.toml', /version = "([^"]+)" # x-release-please-version/)],
1618
['src/crates/services/relay-service/Cargo.toml', readTomlVersion('src/crates/services/relay-service/Cargo.toml', /^version = "([^"]+)"/m)],
1719
['src/crates/services/page-function-runtime/Cargo.toml', readTomlVersion('src/crates/services/page-function-runtime/Cargo.toml', /^version = "([^"]+)"/m)],
20+
]);
21+
22+
const mobileVersions = new Map([
1823
['src/apps/mobile/android/app/build.gradle.kts', readTextVersion('src/apps/mobile/android/app/build.gradle.kts', /versionName\s*=\s*"([^"]+)"/)],
1924
['src/apps/mobile/ios/OpenBitFun/Info.plist', readTextVersion('src/apps/mobile/ios/OpenBitFun/Info.plist', /<key>CFBundleShortVersionString<\/key>\s*<string>([^<]+)<\/string>/)],
2025
['src/apps/mobile/harmonyos/AppScope/app.json5', readTextVersion('src/apps/mobile/harmonyos/AppScope/app.json5', /"versionName"\s*:\s*"([^"]+)"/)],
@@ -26,13 +31,18 @@ if (!expected.includes('-')) {
2631
}
2732

2833
const mismatches = [...versions].filter(([, version]) => version !== expected);
29-
if (mismatches.length > 0) {
30-
for (const [file, version] of mismatches) {
31-
console.error(`[release-version] ${file}: expected ${expected}, found ${version}`);
32-
}
34+
const mobileExpected = args['mobile-version'] || mobileVersions.values().next().value;
35+
const mobileMismatches = [...mobileVersions].filter(([, version]) => version !== mobileExpected);
36+
for (const [file, version] of mismatches) {
37+
console.error(`[release-version] ${file}: expected ${expected}, found ${version}`);
38+
}
39+
for (const [file, version] of mobileMismatches) {
40+
console.error(`[release-version] ${file}: expected mobile ${mobileExpected}, found ${version}`);
41+
}
42+
if (mismatches.length > 0 || mobileMismatches.length > 0) {
3343
process.exit(1);
3444
}
35-
console.log(`[release-version] OK: ${expected}`);
45+
console.log(`[release-version] OK: desktop ${expected}; mobile ${mobileExpected}`);
3646

3747
function readJsonVersion(file) {
3848
return JSON.parse(readFileSync(file, 'utf8')).version;

‎src/apps/mobile/android/app/build.gradle.kts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ android {
2727
minSdk = libs.versions.androidMinSdk.get().toInt()
2828
targetSdk = libs.versions.androidTargetSdk.get().toInt()
2929
versionCode = 1
30-
versionName = "1.0.2"
30+
versionName = "1.0.0"
3131
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3232
}
3333

‎src/apps/mobile/harmonyos/AppScope/app.json5‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// upgrades retain encrypted sessions, preferences, and watch handoff data.
55
"bundleName": "com.bitfun.app",
66
"vendor": "OpenBitFun",
7-
"versionCode": 1,
8-
"versionName": "1.0.2", // x-release-please-version
7+
"versionCode": 4,
8+
"versionName": "1.0.0", // x-release-please-version
99
"buildVersion": "1",
1010
"icon": "$media:openbitfun_app_icon",
1111
"label": "$string:app_name",

‎src/apps/mobile/ios/OpenBitFun/Info.plist‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<key>CFBundlePackageType</key>
1414
<string>APPL</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>1.0.2</string>
16+
<string>1.0.0</string>
1717
<key>CFBundleVersion</key>
18-
<string>1</string>
18+
<string>2</string>
1919
<key>CFBundleURLTypes</key>
2020
<array>
2121
<dict>

0 commit comments

Comments
 (0)