Skip to content

Commit 0e134c6

Browse files
fix: address all 37 PR review comments from Greptile + CodeRabbit
Batch fix for every actionable review comment on PR #478: release.yml hardening: - Version mismatch now exits 1 (was warning-only) — prevents releasing with wrong version in VERSIONS file - Removed `|| true` from Kotlin gradle build + Web npm pack — build failures now properly fail the release - Publish job requires iOS/Android/Web native builds to succeed (was `always()` which created releases with missing artifacts) - Release created as draft (engineer manually publishes after verify) package-sdk.sh (Kotlin, Swift, RN): - Clean staging dir (`rm -rf`) before copying natives when --natives-from given — prevents stale .so/.xcframework from prior runs leaking in - validate-artifact.sh failures propagated in CI mode (no `|| true`); local mode stays tolerant sync-versions.sh: - bump_json_version anchored to `^ "version":` (2-space indent) so it only matches the top-level version field, not nested ones in peerDependenciesMeta/overrides/resolutions .gitleaksbaseline: - Redacted Match field which contained real API key suffixes — now shows `REDACTED (rule-name)` instead of the actual token body Other nits: - AGENTS.md: renamed stale `testLocal` label → `useLocalNatives` - Root gradle.properties: added `runanywhere.useLocalNatives=false` alongside legacy `testLocal` for backwards compat - Kotlin gradle.properties: kept both `useLocalNatives` and `testLocal` lines so build-kotlin.sh's sed rewrites still work False positive dismissed: - pr-build.yml "missing done" (CodeRabbit #3084027246) — `done` is at line 475, confirmed by 5+ green CI runs of the summary job Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2f0561e commit 0e134c6

9 files changed

Lines changed: 93 additions & 67 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ jobs:
5757
# VERSIONS file should already be bumped before tag (sync-versions.sh)
5858
PROJECT_VERSION=$(grep -E '^PROJECT_VERSION=' sdk/runanywhere-commons/VERSIONS | cut -d= -f2 | xargs)
5959
if [ "$PROJECT_VERSION" != "$V" ]; then
60-
echo "::warning::PROJECT_VERSION in VERSIONS is '$PROJECT_VERSION' but releasing '$V'."
61-
echo "::warning::Run scripts/sync-versions.sh $V before tagging next time."
60+
echo "::error::PROJECT_VERSION in VERSIONS is '$PROJECT_VERSION' but releasing '$V'."
61+
echo "::error::Run scripts/sync-versions.sh $V before tagging."
62+
exit 1
6263
fi
6364
6465
# ---------------------------------------------------------------------------
@@ -267,7 +268,7 @@ jobs:
267268
ls -la sdk/runanywhere-kotlin/src/androidMain/jniLibs/ || true
268269
- name: Build Kotlin AAR + JAR
269270
working-directory: sdk/runanywhere-kotlin
270-
run: ./gradlew build assembleRelease -x test --no-daemon || true
271+
run: ./gradlew build assembleRelease -x test --no-daemon
271272
- name: Collect Kotlin SDK artifacts
272273
run: |
273274
mkdir -p sdk-staging/kotlin
@@ -314,7 +315,7 @@ jobs:
314315
run: |
315316
mkdir -p ../../sdk-staging/web
316317
for pkg in packages/core packages/llamacpp packages/onnx; do
317-
(cd "$pkg" && npm pack --pack-destination ../../../../sdk-staging/web/) || true
318+
(cd "$pkg" && npm pack --pack-destination ../../../../sdk-staging/web/)
318319
done
319320
ls -la ../../sdk-staging/web/ || true
320321
for f in ../../sdk-staging/web/*.tgz; do
@@ -500,7 +501,15 @@ jobs:
500501
- native_web
501502
- sdk_kotlin
502503
- sdk_web
503-
if: always() && needs.validate.result == 'success'
504+
if: >-
505+
needs.validate.result == 'success' &&
506+
needs.native_ios.result == 'success' &&
507+
needs.native_android.result == 'success' &&
508+
needs.native_linux.result != 'failure' &&
509+
needs.native_windows.result != 'failure' &&
510+
needs.native_web.result == 'success' &&
511+
needs.sdk_kotlin.result != 'failure' &&
512+
needs.sdk_web.result != 'failure'
504513
runs-on: ubuntu-latest
505514
steps:
506515
- uses: actions/checkout@v4
@@ -543,6 +552,7 @@ jobs:
543552
with:
544553
tag_name: v${{ needs.validate.outputs.version }}
545554
name: v${{ needs.validate.outputs.version }}
555+
draft: true
546556
generate_release_notes: true
547557
files: |
548558
release-flat/*

.gitleaksbaseline

Lines changed: 58 additions & 58 deletions
Large diffs are not rendered by default.

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This is a cross-platform SDK monorepo. On a Linux cloud VM, the buildable servic
2121

2222
- **Android SDK**: Installed at `/opt/android-sdk`. `ANDROID_HOME` and `JAVA_HOME` are set in `~/.bashrc`.
2323
- **JDK 17**: Required by Gradle JVM toolchain. Both JDK 17 and JDK 21 are installed.
24-
- **`testLocal` flag**: Set to `true` in `gradle.properties`. Pass `-Prunanywhere.useLocalNatives=false` to Gradle to avoid needing Android NDK (downloads pre-built JNI libs from GitHub releases instead of building locally).
24+
- **`useLocalNatives` flag**: Set to `true` in `gradle.properties`. Pass `-Prunanywhere.useLocalNatives=false` to Gradle to avoid needing Android NDK (downloads pre-built JNI libs from GitHub releases instead of building locally).
2525
- **C++ compiler**: Default clang on this VM lacks `libc++` headers. Use `gcc`/`g++` via `-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++`.
2626
- **`local.properties`**: Auto-created at root, `sdk/runanywhere-kotlin/`, and `examples/android/RunAnywhereAI/` with `sdk.dir=/opt/android-sdk`.
2727
- **pre-commit hooks**: Installed via `pre-commit install`. Requires `git config --unset-all core.hooksPath` first if `core.hooksPath` is set.

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ org.gradle.configureondemand=true
1010
kotlin.code.style=official
1111
# KMP configuration
1212
kotlin.mpp.applyDefaultHierarchyTemplate=false
13+
runanywhere.useLocalNatives=false
1314
runanywhere.testLocal=false

scripts/sync-versions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bump_line() {
6565

6666
bump_json_version() {
6767
local file="$1"
68-
bump_line "$file" '"version": "[^"]+"' "\"version\": \"${NEW_VERSION}\""
68+
bump_line "$file" '^ "version": "[^"]+"' " \"version\": \"${NEW_VERSION}\""
6969
}
7070

7171
bump_pubspec_version() {

sdk/runanywhere-kotlin/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ kotlin.mpp.applyDefaultHierarchyTemplate=false
4242
# =============================================================================
4343
runanywhere.useLocalNatives=false
4444

45+
# Legacy alias — build-kotlin.sh still rewrites this line via sed.
46+
# Prefer runanywhere.useLocalNatives above; keep this for backwards compat.
47+
runanywhere.testLocal=false
48+
4549
# Force rebuild of runanywhere-commons C++ code (default: false)
4650
# Set to true when you've made changes to C++ source files
4751
runanywhere.rebuildCommons=false

sdk/runanywhere-kotlin/scripts/package-sdk.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ JNI_DIR="${KOTLIN_ROOT}/src/androidMain/jniLibs"
4949
if [ -n "$NATIVES_FROM" ]; then
5050
[ -d "$NATIVES_FROM" ] || { echo "ERROR: --natives-from not found: $NATIVES_FROM" >&2; exit 1; }
5151
echo ">> Staging .so files from $NATIVES_FROM$JNI_DIR"
52+
rm -rf "$JNI_DIR"
5253
mkdir -p "$JNI_DIR"
5354
for abi in arm64-v8a armeabi-v7a x86_64 x86; do
5455
if [ -d "$NATIVES_FROM/$abi" ]; then
@@ -102,5 +103,9 @@ done
102103

103104
if [ -x "${REPO_ROOT}/scripts/validate-artifact.sh" ]; then
104105
echo ""
105-
"${REPO_ROOT}/scripts/validate-artifact.sh" "$DIST_DIR"/*.aar "$DIST_DIR"/*.jar 2>/dev/null || true
106+
if [ "$RAC_BUILD_MODE" = "ci" ]; then
107+
"${REPO_ROOT}/scripts/validate-artifact.sh" "$DIST_DIR"/*.aar "$DIST_DIR"/*.jar 2>/dev/null
108+
else
109+
"${REPO_ROOT}/scripts/validate-artifact.sh" "$DIST_DIR"/*.aar "$DIST_DIR"/*.jar 2>/dev/null || true
110+
fi
106111
fi

sdk/runanywhere-react-native/scripts/package-sdk.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ if [ -n "$NATIVES_FROM" ]; then
4545
for pkg_dir in "$RN_ROOT/packages"/*/; do
4646
pkg=$(basename "$pkg_dir")
4747
android_jni="$pkg_dir/android/src/main/jniLibs"
48+
rm -rf "$android_jni" "$pkg_dir/ios/Frameworks"
4849
for abi in arm64-v8a armeabi-v7a x86_64 x86; do
4950
if [ -d "$NATIVES_FROM/$abi" ]; then
5051
mkdir -p "$android_jni/$abi"
@@ -120,5 +121,9 @@ done
120121

121122
if [ -x "${REPO_ROOT}/scripts/validate-artifact.sh" ]; then
122123
echo ""
123-
"${REPO_ROOT}/scripts/validate-artifact.sh" "$DIST_DIR"/*.tgz 2>/dev/null || true
124+
if [ "$RAC_BUILD_MODE" = "ci" ]; then
125+
"${REPO_ROOT}/scripts/validate-artifact.sh" "$DIST_DIR"/*.tgz 2>/dev/null
126+
else
127+
"${REPO_ROOT}/scripts/validate-artifact.sh" "$DIST_DIR"/*.tgz 2>/dev/null || true
128+
fi
124129
fi

sdk/runanywhere-swift/scripts/package-sdk.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if [ -n "$NATIVES_FROM" ] && [ "$NATIVES_FROM" != "$BINARIES_DIR" ]; then
5151
exit 1
5252
fi
5353
echo ">> Staging XCFrameworks from $NATIVES_FROM$BINARIES_DIR"
54+
rm -rf "$BINARIES_DIR"
5455
mkdir -p "$BINARIES_DIR"
5556
# Handle both loose xcframeworks and zipped ones
5657
find "$NATIVES_FROM" -maxdepth 3 -name "*.xcframework" -type d -exec cp -R {} "$BINARIES_DIR/" \; 2>/dev/null || true

0 commit comments

Comments
 (0)