diff --git a/android/app/build.gradle b/android/app/build.gradle index 3910facb..e1dd87a5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -94,8 +94,8 @@ android { applicationId 'cc.agentlabs.opencode' minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 41 - versionName "0.4.14" + versionCode 42 + versionName "0.4.15" buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\"" } diff --git a/app.json b/app.json index 7f5c94f3..f3ff1218 100644 --- a/app.json +++ b/app.json @@ -35,7 +35,7 @@ }, "android": { "package": "cc.agentlabs.opencode", - "versionCode": 41, + "versionCode": 42, "usesCleartextTraffic": true, "adaptiveIcon": { "foregroundImage": "./assets/adaptive-icon.png", diff --git a/distribution/changelogs/42.txt b/distribution/changelogs/42.txt new file mode 100644 index 00000000..334c09eb --- /dev/null +++ b/distribution/changelogs/42.txt @@ -0,0 +1,5 @@ +v0.4.15 — The app now tells you when a new version is out + +• Installs from a downloaded APK, F-Droid or a mirror had no way to learn a newer version existed. The app now checks once a day and shows a dismissible banner when one is available. +• "Not now" is remembered for that version only. +• Settings now shows the version you are actually running instead of a hard-coded placeholder. diff --git a/fastlane/metadata/android/en-US/changelogs/42.txt b/fastlane/metadata/android/en-US/changelogs/42.txt new file mode 100644 index 00000000..334c09eb --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/42.txt @@ -0,0 +1,5 @@ +v0.4.15 — The app now tells you when a new version is out + +• Installs from a downloaded APK, F-Droid or a mirror had no way to learn a newer version existed. The app now checks once a day and shows a dismissible banner when one is available. +• "Not now" is remembered for that version only. +• Settings now shows the version you are actually running instead of a hard-coded placeholder. diff --git a/scripts/check-version-parity.mjs b/scripts/check-version-parity.mjs index 2c3eba29..74683b82 100644 --- a/scripts/check-version-parity.mjs +++ b/scripts/check-version-parity.mjs @@ -23,6 +23,37 @@ if (code !== expectedCode) { errors.push(`Gradle versionCode ${Number.isNaN(code) ? "missing" : code} != app.json versionCode ${expectedCode}`); } +// A versionCode left at the previous release's value is the silent half of this +// failure: version metadata is internally consistent, Play still accepts the +// upload (CI overrides the code with run_number+100), but the F-Droid repo and +// every direct-APK install key upgrades off versionCode — so a 0.4.15 APK +// carrying 0.4.14's code is never offered to the cohort it was cut for. +// The changelog file is named after the versionCode and its first line names +// the version, so requiring the two to agree pins the code to this release. +const changelogPath = `distribution/changelogs/${expectedCode}.txt`; +let changelog = null; +try { + changelog = await readFile(changelogPath, "utf8"); +} catch { + errors.push(`${changelogPath} is missing — every release needs a changelog named after its versionCode`); +} + +if (changelog !== null) { + const firstLine = changelog.split("\n", 1)[0].trim(); + if (!firstLine.startsWith(`v${expectedName}`)) { + errors.push( + `${changelogPath} describes "${firstLine}", not v${expectedName} — versionCode ${expectedCode} belongs to an earlier release, so bump it`, + ); + } +} + +const fastlanePath = `fastlane/metadata/android/en-US/changelogs/${expectedCode}.txt`; +try { + await readFile(fastlanePath, "utf8"); +} catch { + errors.push(`${fastlanePath} is missing — F-Droid reads its release notes from here`); +} + if (errors.length) { console.error(errors.join("\n")); process.exitCode = 1;