Skip to content

Commit e0bc825

Browse files
committed
release workflow: Only publish 16KB APK (no -16k suffix), add native so max page size check
- Demo APK is now always built with 16KB page size, artifact named cgeDemo-{version}.apk - Add validation step: all native .so in APK must have max LOAD align >= 16KB - Release notes and docs updated to remove explicit 16k suffix, keep language natural - AAR artifact structure remains unchanged
1 parent 858468c commit e0bc825

2 files changed

Lines changed: 47 additions & 5 deletions

File tree

.github/RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The [release workflow](../.github/workflows/release.yml) builds and publishes:
2727
| `gpuimage-plus-{version}-min.aar` || 4KB |
2828
| `gpuimage-plus-{version}-16k-min.aar` || 16KB |
2929

30-
Plus demo APK with video module enabled.
30+
Plus one demo APK with video module enabled.
3131

3232
## Tag Format
3333

.github/workflows/release.yml

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
add-to-path: true
4242

4343
- name: Install build tools
44-
run: sudo apt-get update && sudo apt-get install -y ninja-build jq rsync
44+
run: sudo apt-get update && sudo apt-get install -y ninja-build jq rsync binutils unzip
4545

4646
- name: Set up JDK 17
4747
uses: actions/setup-java@v4
@@ -185,8 +185,8 @@ jobs:
185185
186186
- name: Build demo APK with video module
187187
run: |
188-
echo "🔨 Building demo APK with video module (default configuration)..."
189-
./tasks.sh --enable-cmake --release --enable-video-module --disable-16kb-page-size --build
188+
echo "🔨 Building demo APK with video module..."
189+
./tasks.sh --enable-cmake --release --enable-video-module --enable-16kb-page-size --build
190190
191191
# Find and copy the APK (look specifically for release build output)
192192
APK_PATH=$(find "cgeDemo/build/outputs/apk/release" \( -name "*-release.apk" -o -name "*-release-unsigned.apk" \) | head -1)
@@ -227,6 +227,48 @@ jobs:
227227
fi
228228
229229
echo "✅ APK validation passed"
230+
231+
- name: Validate native libs max page size (16KB)
232+
run: |
233+
echo "🔍 Validating native library max page size in APK..."
234+
APK_FILE=$(ls /tmp/release-artifacts/*.apk | head -1)
235+
EXTRACT_DIR="/tmp/apk-native-check"
236+
237+
rm -rf "$EXTRACT_DIR"
238+
mkdir -p "$EXTRACT_DIR"
239+
unzip -q "$APK_FILE" "lib/*.so" -d "$EXTRACT_DIR"
240+
241+
SO_COUNT=$(find "$EXTRACT_DIR/lib" -type f -name "*.so" | wc -l | tr -d ' ')
242+
if [ "$SO_COUNT" -eq 0 ]; then
243+
echo "❌ No native libraries found in APK: $APK_FILE"
244+
exit 1
245+
fi
246+
247+
while IFS= read -r so_file; do
248+
max_align=0
249+
250+
while IFS= read -r align_hex; do
251+
align_hex=${align_hex#0x}
252+
if [ -z "$align_hex" ]; then
253+
continue
254+
fi
255+
256+
align_dec=$((16#$align_hex))
257+
if [ "$align_dec" -gt "$max_align" ]; then
258+
max_align="$align_dec"
259+
fi
260+
done < <(readelf -l "$so_file" | awk '/LOAD/ {print $NF}')
261+
262+
if [ "$max_align" -lt 16384 ]; then
263+
echo "❌ Invalid max page size in $(basename "$so_file"): ${max_align} bytes (< 16384)"
264+
readelf -l "$so_file"
265+
exit 1
266+
fi
267+
268+
printf " ✓ %s max LOAD align: %d bytes\n" "$(basename "$so_file")" "$max_align"
269+
done < <(find "$EXTRACT_DIR/lib" -type f -name "*.so" | sort)
270+
271+
echo "✅ Native library max page size validation passed"
230272
231273
- name: Package AAR artifacts
232274
run: |
@@ -522,7 +564,7 @@ jobs:
522564
fi
523565
524566
echo "**Demo APK:**" >> $GITHUB_STEP_SUMMARY
525-
echo "- cgeDemo-$VERSION.apk" >> $GITHUB_STEP_SUMMARY
567+
echo "- cgeDemo-$VERSION.apk (video enabled)" >> $GITHUB_STEP_SUMMARY
526568
echo "" >> $GITHUB_STEP_SUMMARY
527569
echo "**AAR Libraries:**" >> $GITHUB_STEP_SUMMARY
528570
echo "- gpuimage-plus-$VERSION.aar (4KB, with video)" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)