release: build iOS distribution with bazel opt

This commit is contained in:
tei
2026-10-07 18:05:30 +09:00
parent 6b48f905d2
commit 078ba40b76
3 changed files with 11 additions and 8 deletions

View File

@@ -25,7 +25,7 @@
- CMake 3.31.6
- Android renderer:OpenGL
- iOS renderer:Metal
- iOS binary build:bazel build --//:renderer=metal //platform/ios:MapLibre.dynamic(仅真机 ios-arm64,不包含 Simulator slice)
- iOS binary build:bazel build -c opt --//:renderer=metal //platform/ios:MapLibre.dynamic(正式优化构建;仅真机 ios-arm64,不包含 Simulator slice)
## 发布目标

View File

@@ -94,6 +94,7 @@ def main() -> None:
"ios": {
"distributionVersion": ios_version,
"renderer": "metal",
"compilationMode": "opt",
"moduleName": "MapLibre",
"artifact": ios,
"swiftPackage": {
@@ -116,12 +117,13 @@ def main() -> None:
"status": "PUBLISHED_PUBLIC_READBACK_PASS",
"distributionVersion": ios_version,
"moduleName": "MapLibre",
"compilationMode": "opt",
"artifact": ios,
"sourceCommit": source_commit,
"swiftPackage": manifest["ios"]["swiftPackage"],
"notes": (
"Metal renderer release built with "
"bazel build --//:renderer=metal //platform/ios:MapLibre.dynamic"
"Metal renderer optimized release built with "
"bazel build -c opt --//:renderer=metal //platform/ios:MapLibre.dynamic"
),
}
(ROOT / "release/maplibre-particle/ios/release-manifest.json").write_text(
@@ -163,7 +165,7 @@ let package = Package(
构建命令固定为:
bazel build --//:renderer=metal //platform/ios:MapLibre.dynamic
bazel build -c opt --//:renderer=metal //platform/ios:MapLibre.dynamic
不得用默认 OpenGL XCFramework 覆盖同版本。新版本必须使用新的 Particle revision。
"""

View File

@@ -98,10 +98,11 @@ build_release() {
cp "$M2_DIR/$f" "$ARTIFACT_DIR/"
done
note "building iOS Metal XCFramework"
(cd "$ROOT" && bazel build --//:renderer=metal //platform/ios:MapLibre.dynamic)
IOS_SOURCE="$ROOT/bazel-out/darwin_x86_64-fastbuild/bin/platform/ios/$IOS_ZIP_NAME"
[[ -f "$IOS_SOURCE" ]] || die "iOS XCFramework zip missing"
note "building iOS Metal XCFramework (Bazel opt)"
(cd "$ROOT" && bazel build -c opt --//:renderer=metal //platform/ios:MapLibre.dynamic)
IOS_SOURCE="$ROOT/bazel-out/darwin_x86_64-opt/bin/platform/ios/$IOS_ZIP_NAME"
[[ "$IOS_SOURCE" == *"-opt/"* ]] || die "iOS release artifact is not from Bazel opt output: $IOS_SOURCE"
[[ -f "$IOS_SOURCE" ]] || die "iOS XCFramework zip missing: $IOS_SOURCE"
local ios_listing
ios_listing="$(unzip -Z1 "$IOS_SOURCE")"
grep -Fq "/ios-arm64/" <<<"$ios_listing" || die "iOS XCFramework missing ios-arm64 device slice"