build(release): pin built source and correct SwiftPM RN dependency note
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled

This commit is contained in:
tei
2026-10-09 16:13:30 +09:00
parent ea5bd393c6
commit 7cfad1c72f
2 changed files with 9 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env python3
from __future__ import annotations
import json
import subprocess
import sys
from pathlib import Path
@@ -8,6 +9,7 @@ from pathlib import Path
PUBLIC_ROOT = "https://pbf.jpcn.ccwu.cc/swift/maplibre-particle"
GIT_REMOTE = "nas:/volume1/work/pbf/swift/maplibre-particle-spm.git"
WORK = Path.home() / "dev/MapLibreParticleDistribution"
ROOT = Path(__file__).resolve().parents[2]
def run(*args: str, cwd: Path | None = None) -> str:
@@ -26,6 +28,8 @@ def main() -> None:
if len(sys.argv) != 3:
raise SystemExit("usage: publish_swiftpm.py <ios-version> <zip-sha256>")
version, checksum = sys.argv[1], sys.argv[2]
rn_pkg = json.loads((ROOT / "packages/maplibre-particle-rn/package.json").read_text())
rn_version = rn_pkg["peerDependencies"]["@maplibre/maplibre-react-native"]
if not WORK.exists():
run("git", "clone", GIT_REMOTE, str(WORK))
@@ -66,7 +70,7 @@ let package = Package(
(WORK / "README.md").write_text(
"# MapLibre Particle SwiftPM Distribution\n\n"
"该仓库只保存 NavSea MapLibre Particle iOS binary distribution 的 SwiftPM manifest。\n"
"产品和模块名固定为 MapLibre,供 MapLibre React Native 11.3.6 消费。\n\n"
f"产品和模块名固定为 MapLibre,供 MapLibre React Native {rn_version} 消费。\n\n"
f"当前版本:{version}。\n"
f"对应 binary:{url}\n"
)

View File

@@ -147,7 +147,10 @@ publish_release() {
local remote_aar_sha remote_rn_sha remote_ios_sha
local pom_name module_name
source_commit="$(git -C "$ROOT" rev-parse HEAD)"
source_commit="${PARTICLE_RELEASE_SOURCE_COMMIT:-$(git -C "$ROOT" rev-parse HEAD)}"
[[ "$source_commit" =~ ^[0-9a-f]{40}$ ]] || die "invalid frozen release source SHA"
git -C "$ROOT" cat-file -e "$source_commit^{commit}" || die "release source commit unavailable"
git -C "$ROOT" merge-base --is-ancestor "$source_commit" HEAD || die "release source commit is not an ancestor of current HEAD"
android_root="/volume1/work/pbf/maven/cc/navsea/maplibre/android-sdk-particle-opengl"
android_final="$android_root/$ANDROID_VERSION"
android_tmp="$android_root/.$ANDROID_VERSION.uploading"