From 93fb20479e70f72aafaf6971d2e588a81781536c Mon Sep 17 00:00:00 2001 From: tei Date: Fri, 9 Oct 2026 21:52:08 +0900 Subject: [PATCH] fix(release): support incremental particle revisions after native 13.6.1 upgrade --- .../prepare_release.py | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/tools/particle_release_pipeline/prepare_release.py b/tools/particle_release_pipeline/prepare_release.py index 1a9c5fe27..41feba4b5 100755 --- a/tools/particle_release_pipeline/prepare_release.py +++ b/tools/particle_release_pipeline/prepare_release.py @@ -97,20 +97,33 @@ def main() -> None: ) readme.write_text(readme_text) - # Both Expo plugins must request the same upstream Native base as the new AAR. + # The Expo plugins already pin the upstream native base on subsequent + # revisions of the same MapLibre release. Accept the current base without + # requiring the long-obsolete 13.4.1 literal on every release. for relative in ( "packages/maplibre-particle-rn/app.plugin.js", "integration/react-native/MapLibreParticleRNTestHost/plugins/withParticleNativeAndroid.js", ): - replace_exact(ROOT / relative, - 'nativeVersion", "13.4.1"', - f'nativeVersion", "{android_base}"') + path = ROOT / relative + text = path.read_text() + matches = re.findall(r'nativeVersion", "([0-9]+\.[0-9]+\.[0-9]+)"', text) + if len(matches) != 1: + die(f"expected one Expo nativeVersion in {path}") + current_native = matches[0] + if current_native not in {base_version(previous_rn_version), android_base}: + die(f"unexpected Expo nativeVersion {current_native} in {path}") + if current_native != android_base: + replace_exact(path, + f'nativeVersion", "{current_native}"', + f'nativeVersion", "{android_base}"') podspec = RN_ROOT / "MapLibreParticleRN.podspec" podtext = podspec.read_text() - if podtext.count('11.3.6') != 2: - die("podspec must contain exactly two pinned RN 11.3.6 references") - podspec.write_text(podtext.replace("11.3.6", "11.5.0")) + if podtext.count("11.3.6") == 2: + # One-time upgrade from the original MapLibre RN peer baseline. + podspec.write_text(podtext.replace("11.3.6", "11.5.0")) + elif podtext.count("11.5.0") != 2: + die("podspec must contain exactly two pinned RN 11.5.0 references") host_path = ROOT / "integration/react-native/MapLibreParticleRNTestHost/package.json" host = json.loads(host_path.read_text())