maint(android): Add archive step to prep release artifacts

This commit is contained in:
Darcy Wong 2025-05-19 14:37:47 +07:00
parent c455b8d74b
commit 86061d0523
3 changed files with 49 additions and 1 deletions

3
android/.gitignore vendored
View file

@ -57,6 +57,9 @@ KMAPro/**/assets/*.kmp
# Play Store release notes (copied from whatsnew.md)
KMAPro/kMAPro/src/main/play/release-notes/**/*.txt
# Release artifacts
upload/
# Eclipse files
.project
.settings/

View file

@ -15,6 +15,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh"
. "$KEYMAN_ROOT/resources/build/zip.inc.sh"
################################ Main script ################################
@ -37,6 +38,7 @@ builder_describe \
build \
test \
"publish Publishes symbols to Sentry and the APKs to the Play Store." \
"archive Copy release artifacts to upload/ and rsync to downloads.keyman" \
"--ci+ Deprecated build option. Remove in 20.0" \
--upload-sentry+ \
":engine=KMEA Keyman Engine for Android" \
@ -71,3 +73,45 @@ function do_test_help() {
builder_run_action test:help do_test_help
builder_run_child_actions publish
# Copy release artifacts to upload/ and rsync to downloads.keyman.com
if builder_start_action archive; then
UPLOAD_PATH="$KEYMAN_ROOT/android/upload/${KEYMAN_VERSION}"
KEYMAN_ENGINE_ANDROID_ZIP="keyman-engine-android-${KEYMAN_VERSION}.zip"
KEYMAN_APK="keyman-${KEYMAN_VERSION}.apk"
FIRSTVOICES_APK="firstvoices-${KEYMAN_VERSION}.apk"
mkdir -p "${UPLOAD_PATH}"
# Create Keyman Engine for Android archive
# zip/7z flags to: (disable progress), output log level 0
cp "${KEYMAN_ROOT}/android/KMAPro/kMAPro/libs/keyman-engine.aar" ./
if [ "$BUILDER_OS" == "win" ]; then
# win uses 7zip flags
ZIP_FILE="${UPLOAD_PATH}/${KEYMAN_ENGINE_ANDROID_ZIP}"
zip_files "${ZIP_FILE[@]}" "-bd" "-bb0" "-x@exclude.in" "keyman-engine.aar" "Samples/" # need a?
else
ZIP_FILE="${UPLOAD_PATH}/${KEYMAN_ENGINE_ANDROID_ZIP}"
zip_files "${ZIP_FILE}" "-r" "-q" "-x@exclude.in" "keyman-engine.aar" "Samples/"
fi
# Copy release APKs
cp "${KEYMAN_ROOT}/android/KMAPro/kMAPro/build/outputs/apk/release/${KEYMAN_APK}" \
"${UPLOAD_PATH}/${KEYMAN_APK}"
cp "${KEYMAN_ROOT}/oem/firstvoices/android/app/build/outputs/apk/release/${FIRSTVOICES_APK}" \
"${UPLOAD_PATH}/${FIRSTVOICES_APK}"
#
# Write download info files
#
cd "${UPLOAD_PATH}"
write_download_info "Keyman Engine for Android" "${KEYMAN_ENGINE_ANDROID_ZIP}" "${KEYMAN_VERSION}" "${KEYMAN_TIER}" "android"
write_download_info "Keyman for Android" "${KEYMAN_APK}" "${KEYMAN_VERSION}" "${KEYMAN_TIER}" "android"
if [ "${RELEASE_OEM_FIRSTVOICES-false}" = true ]; then
write_download_info "FirstVoices Keyboards" "${FIRSTVOICES_APK}" "${KEYMAN_VERSION}" "${KEYMAN_TIER}" "android"
fi
builder_finish_action success archive
fi

1
android/exclude.in Normal file
View file

@ -0,0 +1 @@
Samples/*/build.sh