Skip to content

Commit ffc1e43

Browse files
committed
feat(android): 添加Android平台WebAPI构建支持
- 为Android目标添加file_classification_webapi构建步骤
1 parent d27b222 commit ffc1e43

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/rust.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ jobs:
163163
else
164164
cargo ndk --target ${{ matrix.target }} --platform 21 -- build --release --bin file_classification_cli --verbose
165165
fi
166+
- name: Build WebAPI for Android target
167+
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.build_webapi == 'true' }}
168+
run: |
169+
if [ -n "$FEATURES" ]; then
170+
cargo ndk --target ${{ matrix.target }} --platform 21 -- build --release --bin file_classification_webapi --features "$FEATURES" --verbose
171+
else
172+
cargo ndk --target ${{ matrix.target }} --platform 21 -- build --release --bin file_classification_webapi --verbose
173+
fi
166174
- name: Set Android binary name
167175
run: echo "ANDROID_BINARY_NAME=file_classification_cli" >> $GITHUB_ENV
168176
- name: Upload Android artifacts
@@ -171,6 +179,12 @@ jobs:
171179
with:
172180
name: file_classification_cli-android-${{ matrix.target }}
173181
path: target/${{ matrix.target }}/release/file_classification_cli
182+
- name: Upload Android WebAPI artifacts
183+
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.build_webapi == 'true' }}
184+
uses: actions/upload-artifact@v4
185+
with:
186+
name: file_classification_webapi-android-${{ matrix.target }}
187+
path: target/${{ matrix.target }}/release/file_classification_webapi
174188

175189
build-linux:
176190
name: Build Linux binaries
@@ -450,3 +464,7 @@ jobs:
450464
artifacts/file_classification_cli-android-armv7-linux-androideabi/file_classification_cli
451465
artifacts/file_classification_cli-android-x86_64-linux-android/file_classification_cli
452466
artifacts/file_classification_cli-android-i686-linux-android/file_classification_cli
467+
artifacts/file_classification_webapi-android-aarch64-linux-android/file_classification_webapi
468+
artifacts/file_classification_webapi-android-armv7-linux-androideabi/file_classification_webapi
469+
artifacts/file_classification_webapi-android-x86_64-linux-android/file_classification_webapi
470+
artifacts/file_classification_webapi-android-i686-linux-android/file_classification_webapi

0 commit comments

Comments
 (0)